Verified Commit d92d75f8 authored by Georg Krause's avatar Georg Krause
Browse files

Fix linting of App.vue

parent 60c6a193
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
id="app" id="app"
:key="String($store.state.instance.instanceUrl)" :key="String($store.state.instance.instanceUrl)"
:class="[$store.state.ui.queueFocused ? 'queue-focused' : '', :class="[$store.state.ui.queueFocused ? 'queue-focused' : '',
{'has-bottom-player': $store.state.queue.tracks.length > 0}]" {'has-bottom-player': $store.state.queue.tracks.length > 0}]"
> >
<!-- here, we display custom stylesheets, if any --> <!-- here, we display custom stylesheets, if any -->
<link <link
...@@ -47,7 +47,6 @@ ...@@ -47,7 +47,6 @@
</template> </template>
<script> <script>
import Vue from 'vue'
import axios from 'axios' import axios from 'axios'
import _ from '@/lodash' import _ from '@/lodash'
import { mapState, mapGetters } from 'vuex' import { mapState, mapGetters } from 'vuex'
...@@ -59,11 +58,11 @@ import { getClientOnlyRadio } from '@/radios' ...@@ -59,11 +58,11 @@ import { getClientOnlyRadio } from '@/radios'
import Player from '@/components/audio/Player.vue' import Player from '@/components/audio/Player.vue'
import Queue from '@/components/Queue.vue' import Queue from '@/components/Queue.vue'
import PlaylistModal from '@/components/playlists/PlaylistModal.vue' import PlaylistModal from '@/components/playlists/PlaylistModal.vue'
import UploadModal from '@/components/channels/UploadModal.vue' import ChannelUploadModal from '@/components/channels/UploadModal.vue'
import Sidebar from '@/components/Sidebar.vue' import Sidebar from '@/components/Sidebar.vue'
import ServiceMessages from '@/components/ServiceMessages.vue' import ServiceMessages from '@/components/ServiceMessages.vue'
import SetInstanceModal from '@/components/SetInstanceModal.vue' import SetInstanceModal from '@/components/SetInstanceModal.vue'
import ShortcutsModel from '@/components/ShortcutsModal.vue' import ShortcutsModal from '@/components/ShortcutsModal.vue'
import FilterModal from '@/components/moderation/FilterModal.vue' import FilterModal from '@/components/moderation/FilterModal.vue'
import ReportModal from '@/components/moderation/ReportModal.vue' import ReportModal from '@/components/moderation/ReportModal.vue'
...@@ -191,26 +190,6 @@ export default { ...@@ -191,26 +190,6 @@ export default {
self.$language.current = newValue self.$language.current = newValue
return self.$store.commit('ui/momentLocale', 'en') return self.$store.commit('ui/momentLocale', 'en')
} }
import('./translations/en_GB.json').then((response) => {
Vue.$translations[newValue] = response.default[newValue]
}).finally(() => {
// set current language twice, otherwise we seem to have a cache somewhere
// and rendering does not happen
self.$language.current = 'noop'
self.$language.current = newValue
})
const momentLocale = newValue.replace('_', '-').toLowerCase()
import('moment/locale/en-gb.js').then(() => {
self.$store.commit('ui/momentLocale', momentLocale)
}).catch(() => {
console.log('No momentjs locale available for', momentLocale)
const shortLocale = momentLocale.split('-')[0]
import('moment/locale/en-gb.js').then(() => {
self.$store.commit('ui/momentLocale', shortLocale)
}).catch(() => {
console.log('No momentjs locale available for', shortLocale)
})
})
} }
}, },
currentTrack: { currentTrack: {
...@@ -293,7 +272,7 @@ export default { ...@@ -293,7 +272,7 @@ export default {
// 3. use the current url // 3. use the current url
const defaultInstanceUrl = const defaultInstanceUrl =
this.$store.state.instance.frontSettings.defaultServerUrl || this.$store.state.instance.frontSettings.defaultServerUrl ||
import.meta.env.VUE_APP_INSTANCE_URL || this.$store.getters['instance/defaultUrl']() process.env.VUE_APP_INSTANCE_URL || this.$store.getters['instance/defaultUrl']()
this.$store.commit('instance/instanceUrl', defaultInstanceUrl) this.$store.commit('instance/instanceUrl', defaultInstanceUrl)
} else { } else {
// needed to trigger initialization of axios / service worker // needed to trigger initialization of axios / service worker
...@@ -434,11 +413,10 @@ export default { ...@@ -434,11 +413,10 @@ export default {
this.disconnect() this.disconnect()
const self = this const self = this
const token = this.$store.state.auth.token const token = this.$store.state.auth.token
// let token = 'test'
const bridge = new WebSocketBridge() const bridge = new WebSocketBridge()
this.bridge = bridge this.bridge = bridge
let url = let url =
this.$store.getters['instance/absoluteUrl']('api/v1/activity?token=${token}') this.$store.getters['instance/absoluteUrl'](`api/v1/activity?token=${token}`)
url = url.replace('http://', 'ws://') url = url.replace('http://', 'ws://')
url = url.replace('https://', 'wss://') url = url.replace('https://', 'wss://')
bridge.connect( bridge.connect(
...@@ -457,7 +435,7 @@ export default { ...@@ -457,7 +435,7 @@ export default {
const albumArtist = (track.album) ? track.album.artist.name : null const albumArtist = (track.album) ? track.album.artist.name : null
const artistName = ( const artistName = (
(track.artist) ? track.artist.name : albumArtist) (track.artist) ? track.artist.name : albumArtist)
const text = '♫ ${trackTitle} – ${artistName} ♫' const text = `${trackTitle}${artistName}`
return text return text
}, },
updateDocumentTitle () { updateDocumentTitle () {
...@@ -489,8 +467,8 @@ export default { ...@@ -489,8 +467,8 @@ export default {
}, },
setTheme (theme) { setTheme (theme) {
const oldTheme = (theme === 'light') ? 'dark' : 'light' const oldTheme = (theme === 'light') ? 'dark' : 'light'
document.body.classList.remove('theme-${oldTheme}') document.body.classList.remove(`theme-${oldTheme}`)
document.body.classList.add('theme-${theme}') document.body.classList.add(`theme-${theme}`)
} }
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment