mirror of
https://github.com/HeyPuter/puter.git
synced 2025-02-02 23:28:39 +08:00
Fix permission check for closeApp message
Firstly, I was missing an `async` here, which somehow still worked for
me then, but produced errors for me when I tried it today.
Then, actually await the promise.
Finally, actually check the target's parent is us, and not just that it
has the attribute!
I don't know what was going on in my head that day. 🤦♂️
This commit is contained in:
parent
eb66848aee
commit
776b6831f3
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user