no log: Fix a issue that a non-serialize object is used in redux reducers

pull/1515/head
LASER-Yi 3 years ago
parent 9765c5713c
commit 42f5be9ae3

@ -24,7 +24,7 @@ interface Site {
progress: Site.Progress[]; progress: Site.Progress[];
notifier: { notifier: {
content: string | null; content: string | null;
update: Date; timestamp: string;
}; };
notifications: Server.Notification[]; notifications: Server.Notification[];
sidebar: string; sidebar: string;
@ -37,7 +37,7 @@ const defaultSite: Site = {
progress: [], progress: [],
notifier: { notifier: {
content: null, content: null,
update: new Date(), timestamp: String(Date.now),
}, },
notifications: [], notifications: [],
sidebar: "", sidebar: "",
@ -111,7 +111,7 @@ const reducer = createReducer(defaultSite, (builder) => {
builder.addCase(siteUpdateNotifier, (state, action) => { builder.addCase(siteUpdateNotifier, (state, action) => {
state.notifier.content = action.payload; state.notifier.content = action.payload;
state.notifier.update = new Date(); state.notifier.timestamp = String(Date.now);
}); });
builder builder

@ -154,7 +154,7 @@ const NotificationCenter: FunctionComponent = () => {
if (notifier.content) { if (notifier.content) {
setTooltip(true); setTooltip(true);
} }
}, [notifier.update]); }, [notifier.timestamp]);
return ( return (
<React.Fragment> <React.Fragment>

Loading…
Cancel
Save