fix: auto logout on stale token (#144)

This commit is contained in:
Shinigami 2022-11-26 20:33:36 +01:00 committed by GitHub
parent 2d16c4868e
commit 94f2f95bcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 5 deletions

View file

@ -78,3 +78,17 @@ export function directMessageUser(account: Account) {
visibility: 'direct',
}))
}
export function clearUserDrafts(account?: Account) {
if (!account)
account = currentUser.value?.account
if (!account)
return
const id = `${account.acct}@${currentUser.value?.server}`
if (!allDrafts.value[id])
return
delete allDrafts.value[id]
}