Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jeff
funkwhale
Commits
d92d75f8
Verified
Commit
d92d75f8
authored
Feb 21, 2022
by
Georg Krause
Browse files
Fix linting of App.vue
parent
60c6a193
Changes
1
Hide whitespace changes
Inline
Side-by-side
front/src/App.vue
View file @
d92d75f8
...
...
@@ -3,7 +3,7 @@
id=
"app"
:key=
"String($store.state.instance.instanceUrl)"
: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 -->
<link
...
...
@@ -47,7 +47,6 @@
</
template
>
<
script
>
import
Vue
from
'
vue
'
import
axios
from
'
axios
'
import
_
from
'
@/lodash
'
import
{
mapState
,
mapGetters
}
from
'
vuex
'
...
...
@@ -59,11 +58,11 @@ import { getClientOnlyRadio } from '@/radios'
import
Player
from
'
@/components/audio/Player.vue
'
import
Queue
from
'
@/components/Queue.vue
'
import
PlaylistModal
from
'
@/components/playlists/PlaylistModal.vue
'
import
UploadModal
from
'
@/components/channels/UploadModal.vue
'
import
Channel
UploadModal
from
'
@/components/channels/UploadModal.vue
'
import
Sidebar
from
'
@/components/Sidebar.vue
'
import
ServiceMessages
from
'
@/components/ServiceMessages.vue
'
import
SetInstanceModal
from
'
@/components/SetInstanceModal.vue
'
import
ShortcutsMod
e
l
from
'
@/components/ShortcutsModal.vue
'
import
ShortcutsMod
a
l
from
'
@/components/ShortcutsModal.vue
'
import
FilterModal
from
'
@/components/moderation/FilterModal.vue
'
import
ReportModal
from
'
@/components/moderation/ReportModal.vue
'
...
...
@@ -191,26 +190,6 @@ export default {
self
.
$language
.
current
=
newValue
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
:
{
...
...
@@ -293,7 +272,7 @@ export default {
// 3. use the current url
const
defaultInstanceUrl
=
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
)
}
else
{
// needed to trigger initialization of axios / service worker
...
...
@@ -434,11 +413,10 @@ export default {
this
.
disconnect
()
const
self
=
this
const
token
=
this
.
$store
.
state
.
auth
.
token
// let token = 'test'
const
bridge
=
new
WebSocketBridge
()
this
.
bridge
=
bridge
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
(
'
https://
'
,
'
wss://
'
)
bridge
.
connect
(
...
...
@@ -457,7 +435,7 @@ export default {
const
albumArtist
=
(
track
.
album
)
?
track
.
album
.
artist
.
name
:
null
const
artistName
=
(
(
track
.
artist
)
?
track
.
artist
.
name
:
albumArtist
)
const
text
=
'
♫ ${trackTitle} – ${artistName} ♫
'
const
text
=
`
♫
${
trackTitle
}
–
${
artistName
}
♫
`
return
text
},
updateDocumentTitle
()
{
...
...
@@ -489,8 +467,8 @@ export default {
},
setTheme
(
theme
)
{
const
oldTheme
=
(
theme
===
'
light
'
)
?
'
dark
'
:
'
light
'
document
.
body
.
classList
.
remove
(
'
theme-${oldTheme}
'
)
document
.
body
.
classList
.
add
(
'
theme-${theme}
'
)
document
.
body
.
classList
.
remove
(
`
theme-
${
oldTheme
}
`
)
document
.
body
.
classList
.
add
(
`
theme-
${
theme
}
`
)
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment