mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
refac
This commit is contained in:
parent
f33ca4c9a5
commit
a82154de3f
@ -127,7 +127,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
window.addEventListener('message', async (event) => {
|
const onMessageHandler = async (event) => {
|
||||||
if (event.origin === window.origin) {
|
if (event.origin === window.origin) {
|
||||||
// Replace with your iframe's origin
|
// Replace with your iframe's origin
|
||||||
console.log('Message received from iframe:', event.data);
|
console.log('Message received from iframe:', event.data);
|
||||||
@ -160,7 +160,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
window.addEventListener('message', onMessageHandler);
|
||||||
|
|
||||||
if (!$chatId) {
|
if (!$chatId) {
|
||||||
chatId.subscribe(async (value) => {
|
chatId.subscribe(async (value) => {
|
||||||
@ -173,6 +174,10 @@
|
|||||||
await goto('/');
|
await goto('/');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener('message', onMessageHandler);
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
//////////////////////////
|
//////////////////////////
|
||||||
|
Loading…
Reference in New Issue
Block a user