From 1b88a63f3f6dde57cdbf42c9dee9ae1a9c4bd97e Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Sun, 9 May 2021 22:45:50 +0400 Subject: [PATCH] Fix notification sound status --- src/components/sidebarLeft/tabs/notifications.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/sidebarLeft/tabs/notifications.ts b/src/components/sidebarLeft/tabs/notifications.ts index 587fa56e..f1c1bc6c 100644 --- a/src/components/sidebarLeft/tabs/notifications.ts +++ b/src/components/sidebarLeft/tabs/notifications.ts @@ -7,13 +7,14 @@ import { SettingSection } from ".."; import Row from "../../row"; import CheckboxField from "../../checkboxField"; -import { InputNotifyPeer, PeerNotifySettings, Update } from "../../../layer"; +import { InputNotifyPeer, Update } from "../../../layer"; import appNotificationsManager from "../../../lib/appManagers/appNotificationsManager"; import { SliderSuperTabEventable } from "../../sliderTab"; import { copy } from "../../../helpers/object"; import rootScope from "../../../lib/rootScope"; import { convertKeyToInputKey } from "../../../helpers/string"; import { LangPackKey } from "../../../lib/langPack"; +import appStateManager from "../../../lib/appManagers/appStateManager"; type InputNotifyKey = Exclude; @@ -68,7 +69,7 @@ export default class AppNotificationsTab extends SliderSuperTabEventable { const inputSettings: any = copy(notifySettings); inputSettings._ = 'inputPeerNotifySettings'; - inputSettings.mute_until = mute ? 2147483647 : 0; + inputSettings.mute_until = mute ? 0x7FFFFFFF : 0; inputSettings.show_previews = showPreviews; appNotificationsManager.updateNotifySettings(inputNotifyPeer, inputSettings); @@ -114,7 +115,11 @@ export default class AppNotificationsTab extends SliderSuperTabEventable { const soundRow = new Row({ checkboxField: new CheckboxField({text: 'Notifications.Sound', checked: true, stateKey: 'settings.notifications.sound'}), - subtitleLangKey: 'Checkbox.Enabled', + subtitleLangKey: 'Loading', + }); + + appStateManager.getState().then(state => { + soundRow.checkboxField.checked = state.settings.notifications.sound; }); section.content.append(contactsSignUpRow.container, soundRow.container);