Skip to content

Commit

Permalink
fix: notificationClick-navigate bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ptyoiy committed Jul 3, 2024
1 parent 4415416 commit 0317ab9
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,9 @@ function App() {
navigator.serviceWorker.addEventListener('message', (event) => {
if (!event.data.action) return;
const { data, action } = event.data;
const [type, id] = (data as string).split('=');
switch (action) {
case 'notificationClick':
console.log("data:", event.data);
navigate(`/${type === 'events' ? 'main' : 'notification'}`);
modalDispatch({
payload: 'mainModal',
props: {
postId: +id,
type: type as any
}
});
navigate(`/${data}`);
break;
// skip default
}
Expand Down

0 comments on commit 0317ab9

Please sign in to comment.