瀏覽代碼

Merge pull request #260 from AtkinsSJ/fix-silly-mistakes

Fix permission check for closeApp message
Nariman Jelveh 1 年之前
父節點
當前提交
4052c7995c
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/IPC.js

+ 2 - 2
src/IPC.js

@@ -1116,9 +1116,9 @@ window.addEventListener('message', async (event) => {
         }
 
         // Check permissions
-        const allowed = (() => {
+        const allowed = await (async () => {
             // Parents can close their children
-            if (target_window.dataset['parent_instance_id']) {
+            if (target_window.dataset['parent_instance_id'] === appInstanceID) {
                 console.log(`⚠️ Allowing app ${appInstanceID} to close child app ${targetAppInstanceID}`);
                 return true;
             }