diff --git a/res/css/views/rooms/_EventTile.scss b/res/css/views/rooms/_EventTile.scss index eb0e1dd7b0..3b9a491db5 100644 --- a/res/css/views/rooms/_EventTile.scss +++ b/res/css/views/rooms/_EventTile.scss @@ -394,16 +394,6 @@ $left-gutter: 64px; opacity: 1; } -.mx_EventTile_e2eIcon_hidden { - display: none; -} - -/* always override hidden attribute for blocked and warning */ -.mx_EventTile_e2eIcon_hidden[src*="img/e2e-blocked.svg"], -.mx_EventTile_e2eIcon_hidden[src*="img/e2e-warning.svg"] { - display: block; -} - .mx_EventTile_keyRequestInfo { font-size: $font-12px; } diff --git a/src/Notifier.ts b/src/Notifier.ts index 473de6c161..2643de1abc 100644 --- a/src/Notifier.ts +++ b/src/Notifier.ts @@ -33,6 +33,7 @@ import Modal from './Modal'; import SettingsStore from "./settings/SettingsStore"; import { hideToast as hideNotificationsToast } from "./toasts/DesktopNotificationsToast"; import {SettingLevel} from "./settings/SettingLevel"; +import {isPushNotifyDisabled} from "./settings/controllers/NotificationControllers"; /* * Dispatches: @@ -258,7 +259,7 @@ export const Notifier = { } // set the notifications_hidden flag, as the user has knowingly interacted // with the setting we shouldn't nag them any further - this.setToolbarHidden(true); + this.setPromptHidden(true); }, isEnabled: function() { @@ -283,7 +284,7 @@ export const Notifier = { return SettingsStore.getValue("audioNotificationsEnabled"); }, - setToolbarHidden: function(hidden: boolean, persistent = true) { + setPromptHidden: function(hidden: boolean, persistent = true) { this.toolbarHidden = hidden; Analytics.trackEvent('Notifier', 'Set Toolbar Hidden', hidden); @@ -296,17 +297,17 @@ export const Notifier = { } }, - shouldShowToolbar: function() { + shouldShowPrompt: function() { const client = MatrixClientPeg.get(); if (!client) { return false; } const isGuest = client.isGuest(); - return !isGuest && this.supportsDesktopNotifications() && - !this.isEnabled() && !this._isToolbarHidden(); + return !isGuest && this.supportsDesktopNotifications() && !isPushNotifyDisabled() && + !this.isEnabled() && !this._isPromptHidden(); }, - _isToolbarHidden: function() { + _isPromptHidden: function() { // Check localStorage for any such meta data if (global.localStorage) { return global.localStorage.getItem("notifications_hidden") === "true"; diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 3a8a02c098..dde5dc6fb2 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -1363,7 +1363,7 @@ export default class MatrixChat extends React.PureComponent { this.firstSyncComplete = true; this.firstSyncPromise.resolve(); - if (Notifier.shouldShowToolbar()) { + if (Notifier.shouldShowPrompt()) { showNotificationsToast(); } diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index 647ef585d7..ab9f240f2d 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -1027,11 +1027,7 @@ class E2ePadlock extends React.Component { tooltip = ; } - let classes = `mx_EventTile_e2eIcon mx_EventTile_e2eIcon_${this.props.icon}`; - if (!SettingsStore.getValue("alwaysShowEncryptionIcons")) { - classes += ' mx_EventTile_e2eIcon_hidden'; - } - + const classes = `mx_EventTile_e2eIcon mx_EventTile_e2eIcon_${this.props.icon}`; return (
{ }; const onReject = () => { - Notifier.setToolbarHidden(true); + Notifier.setPromptHidden(true); }; const TOAST_KEY = "desktopnotifications";