Skip to content

Commit cd27f15

Browse files
committed
meh
1 parent 5490743 commit cd27f15

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
@@ -65,23 +65,42 @@ function AppWindowContent({ id, setTitle }: AppWindowProps) {
6565
try {
6666
switch (message.data.type) {
6767
case 'locationUpdate': {
68-
const location = {
69-
pathname: window.location.pathname,
70-
search: new URL(message.data.location).search,
71-
};
72-
router.push(location, undefined, { shallow: true });
68+
if (!message.data.location) {
69+
break;
70+
}
71+
72+
// const location: Location = {
73+
// pathname: window.location.pathname,
74+
// search: .search,
75+
// };
76+
77+
// router.push(location, undefined, { shallow: true });
7378
break;
7479
}
7580

7681
case 'titleUpdate':
77-
setTitle((title) => message.data.title || title);
82+
setTitle((title) => String(message.data.title || title));
7883
break;
7984

8085
case 'appError':
8186
setError(message.data.error);
8287
break;
88+
89+
default:
90+
toast.error(`Unknown app message type: ${message.data.type}`, {
91+
id: 'unknown-message-type',
92+
});
8393
}
84-
} catch {}
94+
} catch (e: any) {
95+
toast.error(
96+
`Error when receiving app message: ${String(e)}\ndata:\n${
97+
message.data
98+
}`,
99+
{
100+
id: 'unknown-message-type',
101+
},
102+
);
103+
}
85104
};
86105

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

0 commit comments

Comments
 (0)