From 14525cd056acbf049968f9ea1c63bcf1060c3b9f Mon Sep 17 00:00:00 2001 From: Steve Richter Date: Thu, 19 Nov 2020 23:22:18 -0500 Subject: [PATCH] Fix formatting --- ui/src/audioplayer/Player.js | 10 ++++++++-- ui/src/personal/Personal.js | 14 +++++++------- ui/src/reducers/settingsReducer.js | 2 +- ui/src/utils/notifications.js | 2 +- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/ui/src/audioplayer/Player.js b/ui/src/audioplayer/Player.js index a67cbab66..1ec2421d0 100644 --- a/ui/src/audioplayer/Player.js +++ b/ui/src/audioplayer/Player.js @@ -55,7 +55,9 @@ const Player = () => { const queue = useSelector((state) => state.queue) const current = queue.current || {} const { authenticated } = useAuthState() - const showNotifications = useSelector((state) => state.settings.notifications || false) + const showNotifications = useSelector( + (state) => state.settings.notifications || false + ) const visible = authenticated && queue.queue.length > 0 const classes = useStyle({ visible }) @@ -233,7 +235,11 @@ const Player = () => { }) } if (showNotifications) { - sendNotification(info.name, `${info.singer} - ${info.album}`, baseUrl(info.cover)) + sendNotification( + info.name, + `${info.singer} - ${info.album}`, + baseUrl(info.cover) + ) } } }, diff --git a/ui/src/personal/Personal.js b/ui/src/personal/Personal.js index f1cb207b2..3d560252f 100644 --- a/ui/src/personal/Personal.js +++ b/ui/src/personal/Personal.js @@ -13,10 +13,7 @@ import { } from 'react-admin' import { makeStyles } from '@material-ui/core/styles' import HelpOutlineIcon from '@material-ui/icons/HelpOutline' -import { - changeTheme, - setNotificationsState, -} from '../actions' +import { changeTheme, setNotificationsState } from '../actions' import themes from '../themes' import { docsUrl } from '../utils' import { useGetLanguageChoices } from '../i18n' @@ -130,7 +127,7 @@ const NotificationsToggle = (props) => { const notify = useNotify() const currentSetting = useSelector((state) => state.settings.notifications) const current = (() => { - if (!("Notification" in window) || Notification.permission !== 'granted') { + if (!('Notification' in window) || Notification.permission !== 'granted') { return false } return currentSetting @@ -139,12 +136,15 @@ const NotificationsToggle = (props) => { return ( { if (notificationsEnabled) { - if (!('Notification' in window) || Notification.permission === 'denied') { + if ( + !('Notification' in window) || + Notification.permission === 'denied' + ) { notify(translate('message.notifications_blocked'), 'warning') notificationsEnabled = false } else { diff --git a/ui/src/reducers/settingsReducer.js b/ui/src/reducers/settingsReducer.js index 8f6b207c0..3ee4de765 100644 --- a/ui/src/reducers/settingsReducer.js +++ b/ui/src/reducers/settingsReducer.js @@ -10,7 +10,7 @@ export const settingsReducer = (previousState = initialState, payload) => { case SET_NOTIFICATIONS_STATE: return { ...previousState, - notifications: data + notifications: data, } default: return previousState diff --git a/ui/src/utils/notifications.js b/ui/src/utils/notifications.js index f732534d6..49d6eeaf7 100644 --- a/ui/src/utils/notifications.js +++ b/ui/src/utils/notifications.js @@ -3,7 +3,7 @@ export const sendNotification = (title, body = '', image = '') => { new Notification(title, { body: body, icon: image, - silent: true + silent: true, }) }