remove remaining currentUser.credentials

This commit is contained in:
Henry Jameson 2026-08-24 20:57:21 +03:00
commit 4d5fcff514
4 changed files with 12 additions and 11 deletions

View file

@ -30,8 +30,8 @@ function showWhoToFollow(panel, reply) {
})
}
function getWhoToFollow(panel) {
const credentials = panel.$useUsersStore().currentUser.credentials
function getWhoToFollow() {
const credentials = useOAuthStore().token
if (credentials) {
panel.usersToFollow.forEach((toFollow) => {
toFollow.name = 'Loading...'
@ -66,7 +66,7 @@ const WhoToFollowPanel = {
watch: {
user: function () {
if (this.suggestionsEnabled) {
getWhoToFollow(this)
getWhoToFollow()
}
},
},
@ -77,7 +77,7 @@ const WhoToFollowPanel = {
id: 0,
}))
if (this.suggestionsEnabled) {
getWhoToFollow(this)
getWhoToFollow()
}
},
}

View file

@ -2,7 +2,7 @@ import { map } from 'lodash'
import { useStatusesStore } from 'src/stores/statuses.js'
import { useTimelinesStore } from 'src/stores/timelines.js'
import { useUsersStore } from 'src/stores/users.js'
import { useOAuthStore } from 'src/stores/oauth.js'
import {
editStatus as apiEditStatus,
@ -28,7 +28,7 @@ const postStatus = ({
const mediaIds = map(media, 'id')
return apiPostStatus({
credentials: useUsersStore().currentUser.credentials,
credentials: useOAuthStore().token
status,
spoilerText,
visibility,
@ -71,7 +71,7 @@ const editStatus = ({
return apiEditStatus({
id: statusId,
credentials: useUsersStore().currentUser.credentials,
credentials: useOAuthStore().token
status,
spoilerText,
sensitive,
@ -101,12 +101,12 @@ const editStatus = ({
}
const uploadMedia = ({ store, formData }) => {
const credentials = useUsersStore().currentUser.credentials
const credentials = useOAuthStore().token
return apiUploadMedia({ credentials, formData }).then(({ data }) => data)
}
const setMediaDescription = ({ store, id, description }) => {
const credentials = useUsersStore().currentUser.credentials
const credentials = useOAuthStore().token
return apiSetMediaDescription({ credentials, id, description }).then(
({ data }) => data,
)

View file

@ -14,6 +14,7 @@ import {
import { useInterfaceStore } from 'src/stores/interface.js'
import { useUsersStore } from 'src/stores/users.js'
import { useOAuthStore } from 'src/stores/oauth.js'
import { fetchKnownDomains } from 'src/api/public.js'
@ -213,7 +214,7 @@ export const useInstanceStore = defineStore('instance', {
async getKnownDomains() {
try {
const { data } = await fetchKnownDomains({
credentials: useUsersStore().currentUser.credentials,
credentials: useOAuthStore().token
})
this.knownDomains = data
} catch (e) {

View file

@ -854,7 +854,7 @@ export const useInterfaceStore = defineStore('interface', {
},
unregisterPushNotifications() {
const token = this.currentUser.credentials
const token = useOAuthStore().token
unregisterPushNotifications(token)
},