mirror of
https://github.com/HeyPuter/puter.git
synced 2026-01-12 08:01:08 -06:00
fix puterjs throwing errors after consuming message events not meant for it (#1612)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user