From 88964b0ab1b7e91da90f12308a0aa680f56ee94d Mon Sep 17 00:00:00 2001 From: svetlagasheva Date: Wed, 4 Aug 2021 10:08:15 +0300 Subject: [PATCH] streamingServerWarningDismissed usage fixed --- src/common/ServerWarning/ServerWarning.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/common/ServerWarning/ServerWarning.js b/src/common/ServerWarning/ServerWarning.js index 33ca36b7b..a60b7f37c 100644 --- a/src/common/ServerWarning/ServerWarning.js +++ b/src/common/ServerWarning/ServerWarning.js @@ -11,27 +11,28 @@ const styles = require('./styles'); const ServerWarning = ({ className }) => { const { core } = useServices(); const profile = useProfile(); - const streamingServerWarningDismissed = new Date(); const onLaterClick = React.useCallback(() => { + const streamingServerWarningDismissed = new Date(); core.transport.dispatch({ action: 'Ctx', args: { action: 'UpdateSettings', args: { ...profile.settings, - streamingServerWarningDismissed: streamingServerWarningDismissed.setMonth(new Date().getMonth() + 1) + streamingServerWarningDismissed: streamingServerWarningDismissed.setMonth(streamingServerWarningDismissed.getMonth() + 1) } } }); }, [profile.settings]); const onDismissedClick = React.useCallback(() => { + const streamingServerWarningDismissed = new Date(); core.transport.dispatch({ action: 'Ctx', args: { action: 'UpdateSettings', args: { ...profile.settings, - streamingServerWarningDismissed: streamingServerWarningDismissed.setFullYear(new Date().getFullYear() + 50) + streamingServerWarningDismissed: streamingServerWarningDismissed.setFullYear(streamingServerWarningDismissed.getFullYear() + 50) } } });