login/logout/register woes

This commit is contained in:
Henry Jameson 2026-08-24 19:24:14 +03:00
commit 556a37e836
11 changed files with 29 additions and 21 deletions

View file

@ -63,8 +63,8 @@ export const useAuthFlowStore = defineStore('authFlow', {
this.settings = {}
},
async login({ access_token: accessToken }) {
useOAuthStore().setToken(accessToken)
useUsersStore().loginUser(accessToken, { root: true })
await useOAuthStore().setToken(accessToken)
await useUsersStore().loginUser(accessToken, { root: true })
this.resetState()
},
},

View file

@ -53,7 +53,7 @@ export const useOAuthStore = defineStore('oauth', {
this.userToken = token
},
clearToken() {
this.userToken = false
this.userToken = null
},
async createApp() {
const instance = useInstanceStore().server

View file

@ -180,7 +180,6 @@ export const useStreamingStore = defineStore('streaming', {
case 'delete':
return [data.id]
default:
console.log('UNKNOWN', eventName, eventStream, data)
return data
}
})()

View file

@ -258,14 +258,24 @@ export const useTimelinesStore = defineStore('timelines', {
timeline.fetcher.startFetching()
},
stopFetchingTimeline(timelineName, reason) {
console.debug(
'[Timelines] Stopped fetching timeline',
timelineName,
'Reason:',
reason,
)
const timeline = this[timelineName]
timeline.fetcher.stopFetching()
if (timeline.fetcher === null) {
console.debug(
'[Timelines] Already inactive timeline',
timelineName,
'Reason:',
reason,
)
return
} else {
timeline.fetcher.stopFetching()
console.debug(
'[Timelines] Stopped fetching timeline',
timelineName,
'Reason:',
reason,
)
}
},
// Queues & Timeline manip