Clear websync setting before switching to another web version
This commit is contained in:
parent
b393b3cad1
commit
d3dbeffb87
@ -14,6 +14,7 @@ import buildClassName from '../../../util/buildClassName';
|
|||||||
import { formatDateToString } from '../../../util/dateFormat';
|
import { formatDateToString } from '../../../util/dateFormat';
|
||||||
import switchTheme from '../../../util/switchTheme';
|
import switchTheme from '../../../util/switchTheme';
|
||||||
import { setPermanentWebVersion } from '../../../util/permanentWebVersion';
|
import { setPermanentWebVersion } from '../../../util/permanentWebVersion';
|
||||||
|
import { clearWebsync } from '../../../util/websync';
|
||||||
import { selectTheme } from '../../../modules/selectors';
|
import { selectTheme } from '../../../modules/selectors';
|
||||||
import { isChatArchived } from '../../../modules/helpers';
|
import { isChatArchived } from '../../../modules/helpers';
|
||||||
import useLang from '../../../hooks/useLang';
|
import useLang from '../../../hooks/useLang';
|
||||||
@ -159,6 +160,7 @@ const LeftMainHeader: FC<OwnProps & StateProps> = ({
|
|||||||
|
|
||||||
const handleSwitchToWebK = () => {
|
const handleSwitchToWebK = () => {
|
||||||
setPermanentWebVersion('K');
|
setPermanentWebVersion('K');
|
||||||
|
clearWebsync();
|
||||||
disableHistoryBack();
|
disableHistoryBack();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -84,3 +84,7 @@ export function startWebsync() {
|
|||||||
forceWebsync(authed);
|
forceWebsync(authed);
|
||||||
}, Math.max(0, timeout * 1000));
|
}, Math.max(0, timeout * 1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function clearWebsync() {
|
||||||
|
localStorage.removeItem(WEBSYNC_KEY);
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user