Skip to content

Commit

Permalink
meh
Browse files Browse the repository at this point in the history
  • Loading branch information
A1Liu committed Mar 6, 2023
1 parent e9877ff commit 80e6a07
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
2 changes: 0 additions & 2 deletions frontend/components/AppToolbar.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

.toolbar {
padding: 0.5rem;
margin: 1.25rem;
margin-bottom: 0;

border-radius: 0.25rem;
background: $dark-blue;
Expand Down
33 changes: 26 additions & 7 deletions frontend/components/AppWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,42 @@ function AppWindowContent({ id, setTitle }: AppWindowProps) {
try {
switch (message.data.type) {
case 'locationUpdate': {
const location = {
pathname: window.location.pathname,
search: new URL(message.data.location).search,
};
router.push(location, undefined, { shallow: true });
if (!message.data.location) {
break;
}

// const location: Location = {
// pathname: window.location.pathname,
// search: .search,
// };

// router.push(location, undefined, { shallow: true });
break;
}

case 'titleUpdate':
setTitle((title) => message.data.title || title);
setTitle((title) => String(message.data.title || title));
break;

case 'appError':
setError(message.data.error);
break;

default:
toast.error(`Unknown app message type: ${message.data.type}`, {
id: 'unknown-message-type',
});
}
} catch {}
} catch (e: any) {
toast.error(
`Error when receiving app message: ${String(e)}\ndata:\n${
message.data
}`,
{
id: 'unknown-message-type',
},
);
}
};

window.addEventListener('message', onMessage);
Expand Down
File renamed without changes.

0 comments on commit 80e6a07

Please sign in to comment.