Save to Local Storage when switching to WebK
This commit is contained in:
parent
8666d61e8c
commit
5c030d9603
@ -57,8 +57,8 @@ type DispatchProps = Pick<GlobalActions, (
|
|||||||
const ANIMATION_LEVEL_OPTIONS = [0, 1, 2];
|
const ANIMATION_LEVEL_OPTIONS = [0, 1, 2];
|
||||||
const MENU_ANIMATION_DURATION = 300;
|
const MENU_ANIMATION_DURATION = 300;
|
||||||
|
|
||||||
const LEGACY_VERSION = 'https://web.telegram.org/?legacy=1';
|
const LEGACY_VERSION_URL = 'https://web.telegram.org/?legacy=1';
|
||||||
const WEBK_VERSION = 'https://web.telegram.org/k/';
|
const WEBK_VERSION_URL = 'https://web.telegram.org/k/';
|
||||||
|
|
||||||
const LeftMainHeader: FC<OwnProps & StateProps & DispatchProps> = ({
|
const LeftMainHeader: FC<OwnProps & StateProps & DispatchProps> = ({
|
||||||
content,
|
content,
|
||||||
@ -158,6 +158,10 @@ const LeftMainHeader: FC<OwnProps & StateProps & DispatchProps> = ({
|
|||||||
setSettingOption({ animationLevel: newLevel });
|
setSettingOption({ animationLevel: newLevel });
|
||||||
}, [animationLevel, setSettingOption]);
|
}, [animationLevel, setSettingOption]);
|
||||||
|
|
||||||
|
const handleSwitchToWebK = () => {
|
||||||
|
localStorage.setItem('kz_version', 'K');
|
||||||
|
};
|
||||||
|
|
||||||
const isSearchFocused = (
|
const isSearchFocused = (
|
||||||
Boolean(globalSearchChatId)
|
Boolean(globalSearchChatId)
|
||||||
|| content === LeftColumnContent.GlobalSearch
|
|| content === LeftColumnContent.GlobalSearch
|
||||||
@ -252,13 +256,14 @@ const LeftMainHeader: FC<OwnProps & StateProps & DispatchProps> = ({
|
|||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon="char-K"
|
icon="char-K"
|
||||||
href={WEBK_VERSION}
|
href={WEBK_VERSION_URL}
|
||||||
|
onClick={handleSwitchToWebK}
|
||||||
>
|
>
|
||||||
Switch to K Version
|
Switch to K Version
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon="char-W"
|
icon="char-W"
|
||||||
href={LEGACY_VERSION}
|
href={LEGACY_VERSION_URL}
|
||||||
>
|
>
|
||||||
Switch to Old Version
|
Switch to Old Version
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user