[WRTjs] Fix SplashScreen instance is not destroyed in VIDEOFINISHED case 81/297081/6 submit/tizen/20230816.160022
authorzhaosy <shiyusy.zhao@samsung.com>
Thu, 10 Aug 2023 03:56:46 +0000 (11:56 +0800)
committerzhaosy <shiyusy.zhao@samsung.com>
Tue, 15 Aug 2023 03:27:37 +0000 (11:27 +0800)
SplashScreen instance is not destroyed in VIDEOFINISHED case,
it caused app can't show to foreground.

Related patch:
https://review.tizen.org/gerrit/297080/

Change-Id: If3c44a252113c4f3900a087cdc49cc7967c50c49
Signed-off-by: zhaosy <shiyusy.zhao@samsung.com>
wrt_app/src/web_application.ts

index b4e7c4e..5c49209 100644 (file)
@@ -184,29 +184,31 @@ export class WebApplication {
   }
 
   hideSplashScreen(reason: string) {
+    let hideReason = 0;
     switch (reason) {
       case 'first-paint': {
-        if (wrt.hideSplashScreen(0) !== false)
-          this.show();
+        hideReason = 0;
         break;
       }
       case 'complete': {
-        if (wrt.hideSplashScreen(1) !== false)
-          this.show();
+        hideReason = 1;
         break;
       }
       case 'custom': {
-        if (wrt.hideSplashScreen(2) !== false)
-          this.show();
+        hideReason = 2;
         break;
       }
       case 'video-finished': {
-        this.show();
+        hideReason = 3;
         break;
       }
       default:
-        break;
+        console.log('hideReason: ' + hideReason);
+        return;
     }
+
+    if (wrt.hideSplashScreen(hideReason) !== false)
+      this.show();
   }
 
   private setupMainWindowEventListener() {