fixup!Minor refactor logic of quit for non-multitasking app 42/255842/1 submit/tizen/20210324.231941
authorliwei <wei90727.li@samsung.com>
Wed, 24 Mar 2021 07:14:22 +0000 (15:14 +0800)
committerliwei <wei90727.li@samsung.com>
Wed, 24 Mar 2021 07:14:30 +0000 (15:14 +0800)
If app is backgroundsupport, window cannot be set to false.

Change-Id: I30a7885cb4013257beffab4c95eb10b5fa7a5379
Signed-off-by: liwei <wei90727.li@samsung.com>
wrt_app/src/web_application.ts

index 9d782c7..7fa658e 100644 (file)
@@ -411,12 +411,14 @@ Then you can get profile log from the initial loading.`;
     this.suspended = true;
     this.windowList[this.windowList.length - 1].hide();
     this.flushData();
-    this.windowList.forEach((window) => window.setEnabled(false));
-    if (!this.backgroundRunnable() && !this.multitaskingSupport) {
-      setTimeout(() => {
-        console.log('multitasking is not supported; quitting app')
-        app.quit();
-      }, 0);
+    if (!this.backgroundRunnable()) {
+      this.windowList.forEach((window) => window.setEnabled(false));
+      if (!this.multitaskingSupport) {
+        setTimeout(() => {
+          console.log('multitasking is not supported; quitting app')
+          app.quit();
+        }, 0);
+      }
     }
   }