fix puterjs throwing errors after consuming message events not meant for it (#1612)

This commit is contained in:
velzie authored and GitHub committed 2025-09-25 11:11:34 -07:00
1 parent 72ee05fefb
commit 8b9fefa4a2
2 files changed
+2 -1

No files matched your search

+1
View File
@@ -275,6 +275,7 @@ class UI extends EventListener {
// Bind the message event listener to the window
let lastDraggedOverElement = null;
(globalThis.document) && window.addEventListener('message', async (e) => {
if (!e.data) return;
// `error`
if(e.data.error){
throw e.data.error;
+1 -1
View File
@@ -20,7 +20,7 @@ export class XDIncomingService extends putility.concepts.Service {
}
const data = event.data;
if ( ! data ) return;
const tag = data.$;
if ( ! tag ) return;
if ( ! this.tagged_listeners_[tag] ) return;