feat: use state based auth instead of store based (#488)
* misc: switch to state for auth * fix: class based auth not working
This commit is contained in:
1 parent
8c6ff77fac
commit
5651ad475d
83 files changed
+395
-469
No files matched your search
@@ -54,14 +54,14 @@
|
||||
let oldScore = score
|
||||
|
||||
const castVote = async (newVote: number) => {
|
||||
if (!$profile?.jwt) {
|
||||
if (!profile.data?.jwt) {
|
||||
toast({ content: $t('toast.loginVoteGate'), type: 'warning' })
|
||||
return
|
||||
}
|
||||
loading = true
|
||||
oldScore = score
|
||||
vote = newVote
|
||||
const res = await voteItem(post, newVote, $profile.jwt).catch((e) => {
|
||||
const res = await voteItem(post, newVote, profile.data.jwt).catch((e) => {
|
||||
toast({ content: errorMessage(e), type: 'error' })
|
||||
return { upvotes: 0, downvotes: 0, score: 0 }
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user