diff --git a/src/keywordnotificationrulemodel.cpp b/src/keywordnotificationrulemodel.cpp index a15f4aa02..e9ac61456 100644 --- a/src/keywordnotificationrulemodel.cpp +++ b/src/keywordnotificationrulemodel.cpp @@ -15,7 +15,9 @@ KeywordNotificationRuleModel::KeywordNotificationRuleModel(QObject *parent) : QAbstractListModel(parent) { - controllerConnectionChanged(); + if (Controller::instance().activeConnection()) { + controllerConnectionChanged(); + } connect(&Controller::instance(), &Controller::activeConnectionChanged, this, &KeywordNotificationRuleModel::controllerConnectionChanged); } diff --git a/src/qml/Settings/GlobalNotificationsPage.qml b/src/qml/Settings/GlobalNotificationsPage.qml index f81b1a651..ab6bdc3fe 100644 --- a/src/qml/Settings/GlobalNotificationsPage.qml +++ b/src/qml/Settings/GlobalNotificationsPage.qml @@ -23,7 +23,7 @@ Kirigami.ScrollablePage { contentItem: MobileForm.FormCheckDelegate { text: i18n("Enable notifications for this account") checked: Config.showNotifications - enabled: !Config.isShowNotificationsImmutable + enabled: !Config.isShowNotificationsImmutable && Controller.activeConnection onToggled: { Config.showNotifications = checked Config.save() @@ -225,6 +225,7 @@ Kirigami.ScrollablePage { Layout.fillWidth: true placeholderText: i18n("Keyword…") + enabled: NotificationsManager.keywordNotificationAction !== PushNotificationAction.Unknown rightActions: Kirigami.Action { icon.name: "edit-clear" @@ -246,6 +247,7 @@ Kirigami.ScrollablePage { Accessible.name: text icon.name: "list-add" display: QQC2.AbstractButton.IconOnly + enabled: NotificationsManager.keywordNotificationAction !== PushNotificationAction.Unknown onClicked: { keywordNotificationRuleModel.addKeyword(keywordAddField.text, PushNotificationAction.On)