move scrobblesAvailable to instance capabilities store
This commit is contained in:
parent
1e93e0a9c3
commit
c2f5840a02
2 changed files with 4 additions and 3 deletions
|
|
@ -16,6 +16,7 @@ import {
|
|||
import apiService from '../services/api/api.service.js'
|
||||
|
||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||
|
||||
const emptyTl = (userId = 0) => ({
|
||||
statuses: [],
|
||||
|
|
@ -41,7 +42,6 @@ export const defaultState = () => ({
|
|||
conversationsObject: {},
|
||||
maxId: 0,
|
||||
favorites: new Set(),
|
||||
pleromaScrobblesAvailable: true, // not reported in nodeinfo
|
||||
timelines: {
|
||||
mentions: emptyTl(),
|
||||
public: emptyTl(),
|
||||
|
|
@ -115,7 +115,7 @@ const sortTimeline = (timeline) => {
|
|||
}
|
||||
|
||||
const getLatestScrobble = (state, user) => {
|
||||
const scrobblesSupport = state.pleromaScrobblesAvailable
|
||||
const scrobblesSupport = useInstanceCapabilitiesStore().pleromaScrobblesAvailable
|
||||
|
||||
if (!scrobblesSupport || !user.name || user.id === 'undefined') {
|
||||
return
|
||||
|
|
@ -134,7 +134,7 @@ const getLatestScrobble = (state, user) => {
|
|||
.fetchScrobbles({ accountId: user.id })
|
||||
.then((scrobbles) => {
|
||||
if (scrobbles?.error) {
|
||||
state.pleromaScrobblesAvailable = false
|
||||
useInstanceCapabilitiesStore().set('pleromaScrobblesAvailable', false)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ const defaultState = {
|
|||
tagPolicyAvailable: false,
|
||||
pollsAvailable: false,
|
||||
localBubble: false, // Akkoma
|
||||
scrobblesSupport: false,
|
||||
}
|
||||
|
||||
export const useInstanceCapabilitiesStore = defineStore(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue