diff --git a/src/components/left/main/LeftMainHeader.tsx b/src/components/left/main/LeftMainHeader.tsx index 97eb792d9..333922bd1 100644 --- a/src/components/left/main/LeftMainHeader.tsx +++ b/src/components/left/main/LeftMainHeader.tsx @@ -14,6 +14,7 @@ import buildClassName from '../../../util/buildClassName'; import { formatDateToString } from '../../../util/dateFormat'; import switchTheme from '../../../util/switchTheme'; import { setPermanentWebVersion } from '../../../util/permanentWebVersion'; +import { clearWebsync } from '../../../util/websync'; import { selectTheme } from '../../../modules/selectors'; import { isChatArchived } from '../../../modules/helpers'; import useLang from '../../../hooks/useLang'; @@ -159,6 +160,7 @@ const LeftMainHeader: FC = ({ const handleSwitchToWebK = () => { setPermanentWebVersion('K'); + clearWebsync(); disableHistoryBack(); }; diff --git a/src/util/websync.ts b/src/util/websync.ts index fb2eadebc..0f5747268 100644 --- a/src/util/websync.ts +++ b/src/util/websync.ts @@ -84,3 +84,7 @@ export function startWebsync() { forceWebsync(authed); }, Math.max(0, timeout * 1000)); } + +export function clearWebsync() { + localStorage.removeItem(WEBSYNC_KEY); +}