Rename SETTINGS
to SettingNames
This commit is contained in:
parent
0701768fd7
commit
5fe5320760
1 changed files with 6 additions and 6 deletions
|
@ -17,7 +17,7 @@
|
||||||
window.Whisper = window.Whisper || {};
|
window.Whisper = window.Whisper || {};
|
||||||
const { Settings } = Signal.Types;
|
const { Settings } = Signal.Types;
|
||||||
|
|
||||||
const SETTINGS = {
|
const SettingNames = {
|
||||||
OFF: 'off',
|
OFF: 'off',
|
||||||
COUNT: 'count',
|
COUNT: 'count',
|
||||||
NAME: 'name',
|
NAME: 'name',
|
||||||
|
@ -66,7 +66,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const setting = this.getSetting();
|
const setting = this.getSetting();
|
||||||
if (setting === SETTINGS.OFF) {
|
if (setting === SettingNames.OFF) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,16 +87,16 @@
|
||||||
|
|
||||||
const last = this.last();
|
const last = this.last();
|
||||||
switch (setting) {
|
switch (setting) {
|
||||||
case SETTINGS.COUNT:
|
case SettingNames.COUNT:
|
||||||
title = 'Signal';
|
title = 'Signal';
|
||||||
message = newMessageCount;
|
message = newMessageCount;
|
||||||
break;
|
break;
|
||||||
case SETTINGS.NAME:
|
case SettingNames.NAME:
|
||||||
title = newMessageCount;
|
title = newMessageCount;
|
||||||
message = `Most recent from ${last.get('title')}`;
|
message = `Most recent from ${last.get('title')}`;
|
||||||
iconUrl = last.get('iconUrl');
|
iconUrl = last.get('iconUrl');
|
||||||
break;
|
break;
|
||||||
case SETTINGS.MESSAGE:
|
case SettingNames.MESSAGE:
|
||||||
if (numNotifications === 1) {
|
if (numNotifications === 1) {
|
||||||
title = last.get('title');
|
title = last.get('title');
|
||||||
} else {
|
} else {
|
||||||
|
@ -137,7 +137,7 @@
|
||||||
this.clear();
|
this.clear();
|
||||||
},
|
},
|
||||||
getSetting() {
|
getSetting() {
|
||||||
return storage.get('notification-setting') || SETTINGS.MESSAGE;
|
return storage.get('notification-setting') || SettingNames.MESSAGE;
|
||||||
},
|
},
|
||||||
onRemove() {
|
onRemove() {
|
||||||
console.log('remove notification');
|
console.log('remove notification');
|
||||||
|
|
Loading…
Add table
Reference in a new issue