[Addon] Add reload value to send to addon 27/264527/2
authorjaekuk, lee <juku1999@samsung.com>
Fri, 24 Sep 2021 02:17:51 +0000 (11:17 +0900)
committerjaekuk, lee <juku1999@samsung.com>
Fri, 24 Sep 2021 02:37:29 +0000 (11:37 +0900)
This patch sends reload value to addon to synchronize app's window information with addon
when resuming app.

Change-Id: I53f2cd613a6c271cfb445d20e84db9230991dee0
Signed-off-by: jaekuk, lee <juku1999@samsung.com>
wrt_app/src/web_application.ts [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 4d4872a..52f69bb
@@ -43,6 +43,7 @@ export class WebApplication {
   inQuit: boolean = false;
   profileDelegate: WebApplicationDelegate;
   splashShown: boolean = false;
+  reload: boolean = false;
 
   constructor(options: RuntimeOption) {
     if (wrt.tv) {
@@ -272,13 +273,13 @@ export class WebApplication {
 
     let loadInfo = appControl.getLoadInfo();
     let src = loadInfo.getSrc();
-    let reload = loadInfo.getReload() || this.profileDelegate.needReload(src);
+    this.reload = loadInfo.getReload() || this.profileDelegate.needReload(src);
     // handle http://tizen.org/appcontrol/operation/main operation specially.
     // only menu-screen app can send launch request with main operation.
     // in this case, web app should have to resume web app not reset.
-    if (reload && appControl.getOperation() == 'http://tizen.org/appcontrol/operation/main')
-      reload = false;
-    if (reload)
+    if (this.reload && appControl.getOperation() == 'http://tizen.org/appcontrol/operation/main')
+      this.reload = false;
+    if (this.reload)
       this.handleAppControlReload(src);
     else
       this.sendAppControlEvent();
@@ -333,7 +334,8 @@ export class WebApplication {
   resume() {
     console.log('WebApplication : resume');
     this.suspended = false;
-    addonManager.emit('lcResume', this.mainWindow.id);
+    addonManager.emit('lcResume', this.mainWindow.id, this.reload);
+    this.reload = false;
 
     if (!this.backgroundRunnable())
       this.windowList.forEach((window) => window.setEnabled(true));