Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added option for user to completely disable all notifications #1173

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions addon/src/_locales/bg/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,10 @@
"message": "Показване на известие след изтриване на група",
"description": "Show notification after group delete"
},
"disableAllNotifications": {
"message": "Напълно деактивирайте всички известия (забележка: това може да скрие важни предупреждения/грешки)",
"description": "Completely disable all notifications (note: this may hide important warnings/errors)"
},
"reloadTab": {
"message": "Презареждане на раздела",
"description": "Reload tab"
Expand Down
4 changes: 4 additions & 0 deletions addon/src/_locales/cs_CZ/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,10 @@
"message": "Ukázat upozornění po smazání skupiny",
"description": "Show notification after group delete"
},
"disableAllNotifications": {
"message": "Zcela deaktivujte všechna upozornění (poznámka: toto může skrýt důležitá varování/chyby)",
"description": "Completely disable all notifications (note: this may hide important warnings/errors)"
},
"reloadTab": {
"message": "Obnovit panel",
"description": "Reload tab"
Expand Down
4 changes: 4 additions & 0 deletions addon/src/_locales/de/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,10 @@
"message": "Benachrichtigung anzeigen, nachdem Gruppe gelöscht wurde",
"description": "Show notification after group delete"
},
"disableAllNotifications": {
"message": "Deaktivieren Sie alle Benachrichtigungen vollständig (Hinweis: Dadurch werden möglicherweise wichtige Warnungen/Fehler ausgeblendet)",
"description": "Completely disable all notifications (note: this may hide important warnings/errors)"
},
"reloadTab": {
"message": "Tab neu laden",
"description": "Reload tab"
Expand Down
4 changes: 4 additions & 0 deletions addon/src/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,10 @@
"message": "Show notification after group delete",
"description": "Show notification after group delete"
},
"disableAllNotifications": {
"message": "Completely disable all notifications (note: this may hide important warnings/errors)",
"description": "Completely disable all notifications (note: this may hide important warnings/errors)"
},
"reloadTab": {
"message": "Reload tab",
"description": "Reload tab"
Expand Down
4 changes: 4 additions & 0 deletions addon/src/_locales/es_AR/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,10 @@
"message": "Mostrar notificación tras la eliminación de un grupo",
"description": "Show notification after group delete"
},
"disableAllNotifications": {
"message": "Desactive completamente todas las notificaciones (nota: esto puede ocultar advertencias/errores importantes)",
"description": "Completely disable all notifications (note: this may hide important warnings/errors)"
},
"reloadTab": {
"message": "Recargar pestaña",
"description": "Reload tab"
Expand Down
4 changes: 4 additions & 0 deletions addon/src/_locales/es_ES/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,10 @@
"message": "Mostrar una notificación luego de borrar un grupo",
"description": "Show notification after group delete"
},
"disableAllNotifications": {
"message": "Desactive completamente todas las notificaciones (nota: esto puede ocultar advertencias/errores importantes)",
"description": "Completely disable all notifications (note: this may hide important warnings/errors)"
},
"reloadTab": {
"message": "Recargar pestaña",
"description": "Reload tab"
Expand Down
4 changes: 4 additions & 0 deletions addon/src/_locales/fr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,10 @@
"message": "Afficher une notification après la suppression d'un groupe",
"description": "Show notification after group delete"
},
"disableAllNotifications": {
"message": "Désactivez complètement toutes les notifications (remarque : cela peut masquer des avertissements/erreurs importants)",
"description": "Completely disable all notifications (note: this may hide important warnings/errors)"
},
"reloadTab": {
"message": "Recharger l'onglet",
"description": "Reload tab"
Expand Down
4 changes: 4 additions & 0 deletions addon/src/_locales/id/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,10 @@
"message": "Tampilkan notifikasi setelah grup dihapus",
"description": "Show notification after group delete"
},
"disableAllNotifications": {
"message": "Nonaktifkan sepenuhnya semua notifikasi (catatan: ini mungkin menyembunyikan peringatan/kesalahan penting)",
"description": "Completely disable all notifications (note: this may hide important warnings/errors)"
},
"reloadTab": {
"message": "Muat ulang tab",
"description": "Reload tab"
Expand Down
4 changes: 4 additions & 0 deletions addon/src/_locales/it/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,10 @@
"message": "Mostra una notifica dopo che un gruppo è stato eliminato",
"description": "Show notification after group delete"
},
"disableAllNotifications": {
"message": "Disattiva completamente tutte le notifiche (nota: ciò potrebbe nascondere avvisi/errori importanti)",
"description": "Completely disable all notifications (note: this may hide important warnings/errors)"
},
"reloadTab": {
"message": "Ricarica la scheda",
"description": "Reload tab"
Expand Down
4 changes: 4 additions & 0 deletions addon/src/_locales/ja/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,10 @@
"message": "グループの削除時に通知を表示する",
"description": "Show notification after group delete"
},
"disableAllNotifications": {
"message": "すべての通知を完全に無効にします (注: これにより、重要な警告/エラーが非表示になる可能性があります)",
"description": "Completely disable all notifications (note: this may hide important warnings/errors)"
},
"reloadTab": {
"message": "タブを再読み込み",
"description": "Reload tab"
Expand Down
4 changes: 4 additions & 0 deletions addon/src/_locales/ko/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,10 @@
"message": "그룹 삭제 후 알림 표시",
"description": "Show notification after group delete"
},
"disableAllNotifications": {
"message": "모든 알림을 완전히 비활성화합니다(참고: 중요한 경고/오류가 숨겨질 수 있음).",
"description": "Completely disable all notifications (note: this may hide important warnings/errors)"
},
"reloadTab": {
"message": "탭 새로고침",
"description": "Reload tab"
Expand Down
4 changes: 4 additions & 0 deletions addon/src/_locales/nl/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,10 @@
"message": "Toon notificatie na het verwijderen van een groep",
"description": "Show notification after group delete"
},
"disableAllNotifications": {
"message": "Schakel alle meldingen volledig uit (let op: dit kan belangrijke waarschuwingen/fouten verbergen)",
"description": "Completely disable all notifications (note: this may hide important warnings/errors)"
},
"reloadTab": {
"message": "Tab vernieuwen",
"description": "Reload tab"
Expand Down
4 changes: 4 additions & 0 deletions addon/src/_locales/pl/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,10 @@
"message": "Pokaż powiadomienie po usunięciu grupy",
"description": "Show notification after group delete"
},
"disableAllNotifications": {
"message": "Całkowicie wyłącz wszystkie powiadomienia (uwaga: może to ukryć ważne ostrzeżenia/błędy)",
"description": "Completely disable all notifications (note: this may hide important warnings/errors)"
},
"reloadTab": {
"message": "Odśwież kartę",
"description": "Reload tab"
Expand Down
4 changes: 4 additions & 0 deletions addon/src/_locales/pt_BR/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,10 @@
"message": "Mostrar notificação após exclusão do grupo",
"description": "Show notification after group delete"
},
"disableAllNotifications": {
"message": "Desative completamente todas as notificações (nota: isso pode ocultar avisos/erros importantes)",
"description": "Completely disable all notifications (note: this may hide important warnings/errors)"
},
"reloadTab": {
"message": "Recarregar aba",
"description": "Reload tab"
Expand Down
4 changes: 4 additions & 0 deletions addon/src/_locales/ru/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,10 @@
"message": "Показать уведомление после удаления группы",
"description": "Show notification after group delete"
},
"disableAllNotifications": {
"message": "Полностью отключите все уведомления (примечание: это может скрыть важные предупреждения/ошибки)",
"description": "Completely disable all notifications (note: this may hide important warnings/errors)"
},
"reloadTab": {
"message": "Обновить вкладку",
"description": "Reload tab"
Expand Down
4 changes: 4 additions & 0 deletions addon/src/_locales/uk/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,10 @@
"message": "Показати повідомлення після видалення групи",
"description": "Show notification after group delete"
},
"disableAllNotifications": {
"message": "Повністю вимкнути всі сповіщення (примітка: це може приховати важливі попередження/помилки)",
"description": "Completely disable all notifications (note: this may hide important warnings/errors)"
},
"reloadTab": {
"message": "Оновити вкладку",
"description": "Reload tab"
Expand Down
4 changes: 4 additions & 0 deletions addon/src/_locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,10 @@
"message": "删除群组后显示通知",
"description": "Show notification after group delete"
},
"disableAllNotifications": {
"message": "完全禁用所有通知(注意:这可能会隐藏重要的警告/错误)",
"description": "Completely disable all notifications (note: this may hide important warnings/errors)"
},
"reloadTab": {
"message": "重新加载标签页",
"description": "Reload tab"
Expand Down
4 changes: 4 additions & 0 deletions addon/src/_locales/zh_TW/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,10 @@
"message": "群組刪除後顯示通知",
"description": "Show notification after group delete"
},
"disableAllNotifications": {
"message": "完全禁用所有通知(注意:这可能会隐藏重要的警告/错误)",
"description": "Completely disable all notifications (note: this may hide important warnings/errors)"
},
"reloadTab": {
"message": "重新載入分頁",
"description": "Reload tab"
Expand Down
1 change: 1 addition & 0 deletions addon/src/js/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ export const DEFAULT_OPTIONS = Object.freeze({
showConfirmDialogBeforeGroupArchiving: true,
showConfirmDialogBeforeGroupDelete: true,
showNotificationAfterGroupDelete: true,
disableAllNotifications: false,
showContextMenuOnTabs: true,
showContextMenuOnLinks: true,
defaultBookmarksParent: DEFAULT_BOOKMARKS_PARENTS[0],
Expand Down
8 changes: 7 additions & 1 deletion addon/src/js/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

import backgroundSelf from './background.js';
import * as Constants from './constants.js';
import JSON from './json.js';

Expand Down Expand Up @@ -138,6 +138,12 @@ export function sliceText(text, length = 50) {
}

export async function notify(message, sec = 20, id = null, iconUrl = null, onClick = null, onClose = null) {
try {
if (backgroundSelf.options.disableAllNotifications) {
return;
}
} catch(err) { /* ignore */ }

if (id) {
await browser.notifications.clear(id);
} else {
Expand Down
6 changes: 6 additions & 0 deletions addon/src/options/Options.vue
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,12 @@
<span v-text="lang('showNotificationAfterGroupDelete')"></span>
</label>
</div>
<div class="field">
<label class="checkbox">
<input v-model="options.disableAllNotifications" type="checkbox" />
<span v-text="lang('disableAllNotifications')"></span>
</label>
</div>
<div class="field">
<label class="checkbox">
<input v-model="options.showTabsWithThumbnailsInManageGroups" type="checkbox" />
Expand Down