Skip to content

Commit 80e6a07

Browse files
committed
meh
1 parent e9877ff commit 80e6a07

3 files changed

Lines changed: 26 additions & 9 deletions

File tree

frontend/components/AppToolbar.module.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
.toolbar {
44
padding: 0.5rem;
5-
margin: 1.25rem;
6-
margin-bottom: 0;
75

86
border-radius: 0.25rem;
97
background: $dark-blue;

frontend/components/AppWindow.tsx

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,23 +72,42 @@ function AppWindowContent({ id, setTitle }: AppWindowProps) {
7272
try {
7373
switch (message.data.type) {
7474
case 'locationUpdate': {
75-
const location = {
76-
pathname: window.location.pathname,
77-
search: new URL(message.data.location).search,
78-
};
79-
router.push(location, undefined, { shallow: true });
75+
if (!message.data.location) {
76+
break;
77+
}
78+
79+
// const location: Location = {
80+
// pathname: window.location.pathname,
81+
// search: .search,
82+
// };
83+
84+
// router.push(location, undefined, { shallow: true });
8085
break;
8186
}
8287

8388
case 'titleUpdate':
84-
setTitle((title) => message.data.title || title);
89+
setTitle((title) => String(message.data.title || title));
8590
break;
8691

8792
case 'appError':
8893
setError(message.data.error);
8994
break;
95+
96+
default:
97+
toast.error(`Unknown app message type: ${message.data.type}`, {
98+
id: 'unknown-message-type',
99+
});
90100
}
91-
} catch {}
101+
} catch (e: any) {
102+
toast.error(
103+
`Error when receiving app message: ${String(e)}\ndata:\n${
104+
message.data
105+
}`,
106+
{
107+
id: 'unknown-message-type',
108+
},
109+
);
110+
}
92111
};
93112

94113
window.addEventListener('message', onMessage);

0 commit comments

Comments
 (0)