Setting to disable notifications, fixes #306

auto_join_3.3
Håvar Aambø Fosstveit 2020-05-06 23:08:51 +02:00
parent c1aa62d22c
commit 457d679382
22 changed files with 62 additions and 14 deletions

View File

@ -38,6 +38,11 @@ export const togglePermanentTopBar = () =>
type : 'TOGGLE_PERMANENT_TOPBAR' type : 'TOGGLE_PERMANENT_TOPBAR'
}); });
export const toggleShowNotifications = () =>
({
type : 'TOGGLE_SHOW_NOTIFICATIONS'
});
export const setEchoCancellation = (echoCancellation) => export const setEchoCancellation = (echoCancellation) =>
({ ({
type : 'SET_ECHO_CANCELLATION', type : 'SET_ECHO_CANCELLATION',

View File

@ -142,6 +142,7 @@ class Room extends React.PureComponent
room, room,
browser, browser,
advancedMode, advancedMode,
showNotifications,
toolAreaOpen, toolAreaOpen,
toggleToolArea, toggleToolArea,
classes, classes,
@ -178,7 +179,9 @@ class Room extends React.PureComponent
<AudioPeers /> <AudioPeers />
<Notifications /> { showNotifications &&
<Notifications />
}
<CssBaseline /> <CssBaseline />
@ -232,6 +235,7 @@ Room.propTypes =
room : appPropTypes.Room.isRequired, room : appPropTypes.Room.isRequired,
browser : PropTypes.object.isRequired, browser : PropTypes.object.isRequired,
advancedMode : PropTypes.bool.isRequired, advancedMode : PropTypes.bool.isRequired,
showNotifications : PropTypes.bool.isRequired,
toolAreaOpen : PropTypes.bool.isRequired, toolAreaOpen : PropTypes.bool.isRequired,
setToolbarsVisible : PropTypes.func.isRequired, setToolbarsVisible : PropTypes.func.isRequired,
toggleToolArea : PropTypes.func.isRequired, toggleToolArea : PropTypes.func.isRequired,
@ -241,10 +245,11 @@ Room.propTypes =
const mapStateToProps = (state) => const mapStateToProps = (state) =>
({ ({
room : state.room, room : state.room,
browser : state.me.browser, browser : state.me.browser,
advancedMode : state.settings.advancedMode, advancedMode : state.settings.advancedMode,
toolAreaOpen : state.toolarea.toolAreaOpen showNotifications : state.settings.showNotifications,
toolAreaOpen : state.toolarea.toolAreaOpen
}); });
const mapDispatchToProps = (dispatch) => const mapDispatchToProps = (dispatch) =>
@ -270,6 +275,7 @@ export default connect(
prev.room === next.room && prev.room === next.room &&
prev.me.browser === next.me.browser && prev.me.browser === next.me.browser &&
prev.settings.advancedMode === next.settings.advancedMode && prev.settings.advancedMode === next.settings.advancedMode &&
prev.settings.showNotifications === next.settings.showNotifications &&
prev.toolarea.toolAreaOpen === next.toolarea.toolAreaOpen prev.toolarea.toolAreaOpen === next.toolarea.toolAreaOpen
); );
} }

View File

@ -30,6 +30,7 @@ const AppearenceSettings = ({
settings, settings,
onTogglePermanentTopBar, onTogglePermanentTopBar,
onToggleHiddenControls, onToggleHiddenControls,
onToggleShowNotifications,
handleChangeMode, handleChangeMode,
classes classes
}) => }) =>
@ -101,18 +102,27 @@ const AppearenceSettings = ({
defaultMessage : 'Hidden media controls' defaultMessage : 'Hidden media controls'
})} })}
/> />
<FormControlLabel
className={classes.setting}
control={<Checkbox checked={settings.showNotifications} onChange={onToggleShowNotifications} value='showNotifications' />}
label={intl.formatMessage({
id : 'settings.showNotifications',
defaultMessage : 'Show notifications'
})}
/>
</React.Fragment> </React.Fragment>
); );
}; };
AppearenceSettings.propTypes = AppearenceSettings.propTypes =
{ {
room : appPropTypes.Room.isRequired, room : appPropTypes.Room.isRequired,
settings : PropTypes.object.isRequired, settings : PropTypes.object.isRequired,
onTogglePermanentTopBar : PropTypes.func.isRequired, onTogglePermanentTopBar : PropTypes.func.isRequired,
onToggleHiddenControls : PropTypes.func.isRequired, onToggleHiddenControls : PropTypes.func.isRequired,
handleChangeMode : PropTypes.func.isRequired, onToggleShowNotifications : PropTypes.func.isRequired,
classes : PropTypes.object.isRequired handleChangeMode : PropTypes.func.isRequired,
classes : PropTypes.object.isRequired
}; };
const mapStateToProps = (state) => const mapStateToProps = (state) =>
@ -122,9 +132,10 @@ const mapStateToProps = (state) =>
}); });
const mapDispatchToProps = { const mapDispatchToProps = {
onTogglePermanentTopBar : settingsActions.togglePermanentTopBar, onTogglePermanentTopBar : settingsActions.togglePermanentTopBar,
onToggleHiddenControls : settingsActions.toggleHiddenControls, onToggleHiddenControls : settingsActions.toggleHiddenControls,
handleChangeMode : roomActions.setDisplayMode onToggleShowNotifications : settingsActions.toggleShowNotifications,
handleChangeMode : roomActions.setDisplayMode
}; };
export default connect( export default connect(

View File

@ -16,6 +16,7 @@ const initialState =
lastN : 4, lastN : 4,
permanentTopBar : true, permanentTopBar : true,
hiddenControls : false, hiddenControls : false,
showNotifications : true,
notificationSounds : true, notificationSounds : true,
...window.config.defaultAudio ...window.config.defaultAudio
}; };
@ -158,6 +159,13 @@ const settings = (state = initialState, action) =>
return { ...state, notificationSounds }; return { ...state, notificationSounds };
} }
case 'TOGGLE_SHOW_NOTIFICATIONS':
{
const showNotifications = !state.showNotifications;
return { ...state, showNotifications };
}
case 'SET_VIDEO_RESOLUTION': case 'SET_VIDEO_RESOLUTION':
{ {
const { resolution } = action.payload; const { resolution } = action.payload;

View File

@ -130,6 +130,7 @@
"settings.lastn": "可见视频数量", "settings.lastn": "可见视频数量",
"settings.hiddenControls": null, "settings.hiddenControls": null,
"settings.notificationSounds": null, "settings.notificationSounds": null,
"settings.showNotifications": null,
"filesharing.saveFileError": "无法保存文件", "filesharing.saveFileError": "无法保存文件",
"filesharing.startingFileShare": "正在尝试共享文件", "filesharing.startingFileShare": "正在尝试共享文件",

View File

@ -129,6 +129,7 @@
"settings.lastn": null, "settings.lastn": null,
"settings.hiddenControls": null, "settings.hiddenControls": null,
"settings.notificationSounds": null, "settings.notificationSounds": null,
"settings.showNotifications": null,
"filesharing.saveFileError": "Není možné uložit soubor", "filesharing.saveFileError": "Není možné uložit soubor",
"filesharing.startingFileShare": "Pokouším se sdílet soubor", "filesharing.startingFileShare": "Pokouším se sdílet soubor",

View File

@ -130,6 +130,7 @@
"settings.lastn": "Anzahl der sichtbaren Videos", "settings.lastn": "Anzahl der sichtbaren Videos",
"settings.hiddenControls": null, "settings.hiddenControls": null,
"settings.notificationSounds": null, "settings.notificationSounds": null,
"settings.showNotifications": null,
"filesharing.saveFileError": "Fehler beim Speichern der Datei", "filesharing.saveFileError": "Fehler beim Speichern der Datei",
"filesharing.startingFileShare": "Starte Teilen der Datei", "filesharing.startingFileShare": "Starte Teilen der Datei",

View File

@ -130,6 +130,7 @@
"settings.lastn": "Antal synlige videoer", "settings.lastn": "Antal synlige videoer",
"settings.hiddenControls": null, "settings.hiddenControls": null,
"settings.notificationSounds": null, "settings.notificationSounds": null,
"settings.showNotifications": null,
"filesharing.saveFileError": "Kan ikke gemme fil", "filesharing.saveFileError": "Kan ikke gemme fil",
"filesharing.startingFileShare": "Forsøger at dele filen", "filesharing.startingFileShare": "Forsøger at dele filen",

View File

@ -130,6 +130,7 @@
"settings.lastn": "Αριθμός ορατών βίντεο", "settings.lastn": "Αριθμός ορατών βίντεο",
"settings.hiddenControls": null, "settings.hiddenControls": null,
"settings.notificationSounds": null, "settings.notificationSounds": null,
"settings.showNotifications": null,
"filesharing.saveFileError": "Αδυναμία αποθήκευσης του αρχείου", "filesharing.saveFileError": "Αδυναμία αποθήκευσης του αρχείου",
"filesharing.startingFileShare": "Προσπάθεια διαμοιρασμού αρχείου", "filesharing.startingFileShare": "Προσπάθεια διαμοιρασμού αρχείου",

View File

@ -130,6 +130,7 @@
"settings.lastn": "Number of visible videos", "settings.lastn": "Number of visible videos",
"settings.hiddenControls": "Hidden media controls", "settings.hiddenControls": "Hidden media controls",
"settings.notificationSounds": "Notification sounds", "settings.notificationSounds": "Notification sounds",
"settings.showNotifications": "Show notifications",
"filesharing.saveFileError": "Unable to save file", "filesharing.saveFileError": "Unable to save file",
"filesharing.startingFileShare": "Attempting to share file", "filesharing.startingFileShare": "Attempting to share file",

View File

@ -130,6 +130,7 @@
"settings.lastn": "Cantidad de videos visibles", "settings.lastn": "Cantidad de videos visibles",
"settings.hiddenControls": null, "settings.hiddenControls": null,
"settings.notificationSounds": null, "settings.notificationSounds": null,
"settings.showNotifications": null,
"filesharing.saveFileError": "No ha sido posible guardar el fichero", "filesharing.saveFileError": "No ha sido posible guardar el fichero",
"filesharing.startingFileShare": "Intentando compartir el fichero", "filesharing.startingFileShare": "Intentando compartir el fichero",

View File

@ -130,6 +130,7 @@
"settings.lastn": "Nombre de vidéos visibles", "settings.lastn": "Nombre de vidéos visibles",
"settings.hiddenControls": null, "settings.hiddenControls": null,
"settings.notificationSounds": null, "settings.notificationSounds": null,
"settings.showNotifications": null,
"filesharing.saveFileError": "Impossible d'enregistrer le fichier", "filesharing.saveFileError": "Impossible d'enregistrer le fichier",
"filesharing.startingFileShare": "Début du transfert de fichier", "filesharing.startingFileShare": "Début du transfert de fichier",

View File

@ -130,6 +130,7 @@
"settings.lastn": "Broj vidljivih videozapisa", "settings.lastn": "Broj vidljivih videozapisa",
"settings.hiddenControls": "Skrivene kontrole medija", "settings.hiddenControls": "Skrivene kontrole medija",
"settings.notificationSounds": "Zvuk obavijesti", "settings.notificationSounds": "Zvuk obavijesti",
"settings.showNotifications": null,
"filesharing.saveFileError": "Nije moguće spremiti datoteku", "filesharing.saveFileError": "Nije moguće spremiti datoteku",
"filesharing.startingFileShare": "Pokušaj dijeljenja datoteke", "filesharing.startingFileShare": "Pokušaj dijeljenja datoteke",

View File

@ -130,6 +130,7 @@
"settings.lastn": "A látható videók száma", "settings.lastn": "A látható videók száma",
"settings.hiddenControls": "Média Gombok automatikus elrejtése", "settings.hiddenControls": "Média Gombok automatikus elrejtése",
"settings.notificationSounds": "Értesítések hangjelzéssel", "settings.notificationSounds": "Értesítések hangjelzéssel",
"settings.showNotifications": null,
"filesharing.saveFileError": "A file-t nem sikerült elmenteni", "filesharing.saveFileError": "A file-t nem sikerült elmenteni",
"filesharing.startingFileShare": "Fájl megosztása", "filesharing.startingFileShare": "Fájl megosztása",

View File

@ -129,6 +129,7 @@
"settings.lastn": "Numero di video visibili", "settings.lastn": "Numero di video visibili",
"settings.hiddenControls": "Controlli media nascosti", "settings.hiddenControls": "Controlli media nascosti",
"settings.notificationSounds": "Suoni di notifica", "settings.notificationSounds": "Suoni di notifica",
"settings.showNotifications": null,
"filesharing.saveFileError": "Impossibile salvare file", "filesharing.saveFileError": "Impossibile salvare file",
"filesharing.startingFileShare": "Tentativo di condivisione file", "filesharing.startingFileShare": "Tentativo di condivisione file",

View File

@ -124,6 +124,7 @@
"settings.lastn": "Jums redzamo video/kameru skaits", "settings.lastn": "Jums redzamo video/kameru skaits",
"settings.hiddenControls": "Slēpto mediju vadība", "settings.hiddenControls": "Slēpto mediju vadība",
"settings.notificationSounds": "Paziņojumu skaņas", "settings.notificationSounds": "Paziņojumu skaņas",
"settings.showNotifications": null,
"filesharing.saveFileError": "Nav iespējams saglabāt failu", "filesharing.saveFileError": "Nav iespējams saglabāt failu",
"filesharing.startingFileShare": "Tiek mēģināts kopīgot failu", "filesharing.startingFileShare": "Tiek mēģināts kopīgot failu",

View File

@ -130,6 +130,7 @@
"settings.lastn": "Antall videoer synlig", "settings.lastn": "Antall videoer synlig",
"settings.hiddenControls": "Skjul media knapper", "settings.hiddenControls": "Skjul media knapper",
"settings.notificationSounds": "Varslingslyder", "settings.notificationSounds": "Varslingslyder",
"settings.showNotifications": "Vis varslinger",
"filesharing.saveFileError": "Klarte ikke å lagre fil", "filesharing.saveFileError": "Klarte ikke å lagre fil",
"filesharing.startingFileShare": "Starter fildeling", "filesharing.startingFileShare": "Starter fildeling",

View File

@ -130,6 +130,7 @@
"settings.lastn": "Liczba widocznych uczestników (zdalnych)", "settings.lastn": "Liczba widocznych uczestników (zdalnych)",
"settings.hiddenControls": null, "settings.hiddenControls": null,
"settings.notificationSounds": null, "settings.notificationSounds": null,
"settings.showNotifications": null,
"filesharing.saveFileError": "Nie można zapisać pliku", "filesharing.saveFileError": "Nie można zapisać pliku",
"filesharing.startingFileShare": "Próba udostępnienia pliku", "filesharing.startingFileShare": "Próba udostępnienia pliku",

View File

@ -130,6 +130,7 @@
"settings.lastn": "Número de vídeos visíveis", "settings.lastn": "Número de vídeos visíveis",
"settings.hiddenControls": null, "settings.hiddenControls": null,
"settings.notificationSounds": null, "settings.notificationSounds": null,
"settings.showNotifications": null,
"filesharing.saveFileError": "Impossível de gravar o ficheiro", "filesharing.saveFileError": "Impossível de gravar o ficheiro",
"filesharing.startingFileShare": "Tentando partilha de ficheiro", "filesharing.startingFileShare": "Tentando partilha de ficheiro",

View File

@ -130,6 +130,7 @@
"settings.lastn": "Numărul de videoclipuri vizibile", "settings.lastn": "Numărul de videoclipuri vizibile",
"settings.hiddenControls": null, "settings.hiddenControls": null,
"settings.notificationSounds": null, "settings.notificationSounds": null,
"settings.showNotifications": null,
"filesharing.saveFileError": "Încercarea de a salva fișierul a eșuat", "filesharing.saveFileError": "Încercarea de a salva fișierul a eșuat",
"filesharing.startingFileShare": "Partajarea fișierului", "filesharing.startingFileShare": "Partajarea fișierului",

View File

@ -127,6 +127,7 @@
"settings.lastn": "İzlenebilir video sayısı", "settings.lastn": "İzlenebilir video sayısı",
"settings.hiddenControls": null, "settings.hiddenControls": null,
"settings.notificationSounds": null, "settings.notificationSounds": null,
"settings.showNotifications": null,
"filesharing.saveFileError": "Dosya kaydedilemiyor", "filesharing.saveFileError": "Dosya kaydedilemiyor",
"filesharing.startingFileShare": "Paylaşılan dosyaya erişiliyor", "filesharing.startingFileShare": "Paylaşılan dosyaya erişiliyor",

View File

@ -130,6 +130,7 @@
"settings.lastn": "Кількість видимих ​​відео", "settings.lastn": "Кількість видимих ​​відео",
"settings.hiddenControls": null, "settings.hiddenControls": null,
"settings.notificationSounds": null, "settings.notificationSounds": null,
"settings.showNotifications": null,
"filesharing.saveFileError": "Неможливо зберегти файл", "filesharing.saveFileError": "Неможливо зберегти файл",
"filesharing.startingFileShare": "Спроба поділитися файлом", "filesharing.startingFileShare": "Спроба поділитися файлом",