|
@@ -133,17 +133,19 @@ class KMSubscribeWaterMarkWindowController: NSWindowController {
|
|
|
subscribeWaterMarkMainWindow?.endSheet(controller.window!)
|
|
|
controller.window?.close()
|
|
|
subscribeWaterMarkController = nil
|
|
|
- subscribeWaterMarkMainWindow = nil
|
|
|
+// subscribeWaterMarkMainWindow = nil
|
|
|
|
|
|
- DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1.0) {
|
|
|
- if NSApp.mainWindow != nil {
|
|
|
- let controller = KMSubscribeSuccessWindowController.show(window: NSApp.mainWindow!)
|
|
|
- controller.closeAction = { controller in
|
|
|
- controller.closeWindow()
|
|
|
- completion(true, false, false)
|
|
|
- }
|
|
|
+ if subscribeWaterMarkMainWindow != nil {
|
|
|
+ let controller = KMSubscribeSuccessWindowController.show(window: subscribeWaterMarkMainWindow!)
|
|
|
+ controller.closeAction = { controller in
|
|
|
+ controller.closeWindow()
|
|
|
+ completion(true, false, false)
|
|
|
}
|
|
|
+ subscribeWaterMarkMainWindow = nil
|
|
|
+ } else {
|
|
|
+ completion(true, false, false)
|
|
|
}
|
|
|
+
|
|
|
} else {
|
|
|
KMComparativeTableViewController.purchasefailed(view: subscribeWaterMarkController?.waterMarkView, state: error)
|
|
|
completion(false, false, false)
|
|
@@ -162,15 +164,7 @@ class KMSubscribeWaterMarkWindowController: NSWindowController {
|
|
|
subscribeWaterMarkController = nil
|
|
|
subscribeWaterMarkMainWindow = nil
|
|
|
|
|
|
- DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1.0) {
|
|
|
- if NSApp.mainWindow != nil {
|
|
|
- let controller = KMSubscribeSuccessWindowController.show(window: NSApp.mainWindow!)
|
|
|
- controller.closeAction = { controller in
|
|
|
- controller.closeWindow()
|
|
|
- completion(true, false, false)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ completion(true, false, false)
|
|
|
} else {
|
|
|
if error != .restoreSuccess {
|
|
|
KMComparativeTableViewController.purchasefailed(view: subscribeWaterMarkController?.waterMarkView, state: error)
|