|
@@ -335,31 +335,33 @@ class KMAIRewritingVC: NSViewController {
|
|
|
|
|
|
@IBAction func aiRewritingAction(_ sender: NSButton) {
|
|
|
if self.uiState == .CanAIRewriting || self.uiState == .CanAIErrorCorrection || self.uiState == .CanCopy || self.uiState == .Copyed || self.uiState == .Exceed || self.uiState == .Error {
|
|
|
-// if !KMLightMemberManager.manager.isLogin() {
|
|
|
-// KMLoginWindowController.show(window: NSApp.mainWindow!)
|
|
|
+ if !KMLightMemberManager.manager.isLogin() {
|
|
|
+ KMLoginWindowController.show(window: NSApp.mainWindow!)
|
|
|
+
|
|
|
+ return
|
|
|
+ }
|
|
|
+ self._aiRewritingAction(sender)
|
|
|
+
|
|
|
+// Task { @MainActor in
|
|
|
+// if await (KMLightMemberManager.manager.canPayFunction() == false) {
|
|
|
+// var type: KMSubscribeWaterMarkType = .aiRewrite
|
|
|
+// if (self.state == .AIErrorCorrection) {
|
|
|
+// type = .aiCorrect
|
|
|
+// }
|
|
|
+// let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, type: type) { isSub, _, isClose in
|
|
|
+// if (isClose) {
|
|
|
+// return
|
|
|
+// }
|
|
|
+// if (isSub) {
|
|
|
+// self._aiRewritingAction(sender)
|
|
|
+// return
|
|
|
+// }
|
|
|
+// }
|
|
|
+// return
|
|
|
+// }
|
|
|
//
|
|
|
-// return
|
|
|
+// self._aiRewritingAction(sender)
|
|
|
// }
|
|
|
- Task { @MainActor in
|
|
|
- if await (KMLightMemberManager.manager.canPayFunction() == false) {
|
|
|
- var type: KMSubscribeWaterMarkType = .aiRewrite
|
|
|
- if (self.state == .AIErrorCorrection) {
|
|
|
- type = .aiCorrect
|
|
|
- }
|
|
|
- let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, type: type) { isSub, _, isClose in
|
|
|
- if (isClose) {
|
|
|
- return
|
|
|
- }
|
|
|
- if (isSub) {
|
|
|
- self._aiRewritingAction(sender)
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- self._aiRewritingAction(sender)
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -408,26 +410,27 @@ class KMAIRewritingVC: NSViewController {
|
|
|
|
|
|
@IBAction func copyAction(_ sender: NSButton) {
|
|
|
if self.uiState == .CanCopy || self.uiState == .Copyed {
|
|
|
-// if !KMLightMemberManager.manager.isLogin() {
|
|
|
-// KMLoginWindowController.show(window: NSApp.mainWindow!)
|
|
|
-//
|
|
|
-// return
|
|
|
-// }
|
|
|
- Task { @MainActor in
|
|
|
- if await (KMLightMemberManager.manager.canPayFunction() == false) {
|
|
|
- let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, type: .aiRewrite) { isSub, _, isClose in
|
|
|
- if (isClose) {
|
|
|
- return
|
|
|
- }
|
|
|
- if (isSub) {
|
|
|
- self._copyAction(sender)
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
- return
|
|
|
- }
|
|
|
- self._copyAction(sender)
|
|
|
+ if !KMLightMemberManager.manager.isLogin() {
|
|
|
+ KMLoginWindowController.show(window: NSApp.mainWindow!)
|
|
|
+
|
|
|
+ return
|
|
|
}
|
|
|
+ self._copyAction(sender)
|
|
|
+// Task { @MainActor in
|
|
|
+// if await (KMLightMemberManager.manager.canPayFunction() == false) {
|
|
|
+// let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, type: .aiRewrite) { isSub, _, isClose in
|
|
|
+// if (isClose) {
|
|
|
+// return
|
|
|
+// }
|
|
|
+// if (isSub) {
|
|
|
+// self._copyAction(sender)
|
|
|
+// return
|
|
|
+// }
|
|
|
+// }
|
|
|
+// return
|
|
|
+// }
|
|
|
+// self._copyAction(sender)
|
|
|
+// }
|
|
|
}
|
|
|
}
|
|
|
|