move window event listener to be registered sooner
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 31s Details

This commit is contained in:
Ladd Hoffman 2024-04-25 14:32:47 -05:00
parent 1867aef9ec
commit 857500dc9f
2 changed files with 8 additions and 7 deletions

View File

@ -253,13 +253,6 @@ function Widget() {
useEffect(() => {
console.log('window.location', window.location);
window.addEventListener(
'message',
(event) => {
if (event.data?.target?.startsWith('metamask')) return;
console.log('window message', event);
},
);
window.widgetApiPromise.then((api) => {
console.log('widgetApi promise resolved', api);

View File

@ -14,6 +14,14 @@ import Widget from './Widget';
window.widgetApiPromise = WidgetApiImpl.create({});
window.addEventListener(
'message',
(event) => {
if (event.data?.target?.startsWith('metamask')) return;
console.log('window message', event);
},
);
const router = createBrowserRouter([
{
path: '/',