remove remaining currentUser.credentials
This commit is contained in:
parent
8c568d3653
commit
4d5fcff514
4 changed files with 12 additions and 11 deletions
|
|
@ -30,8 +30,8 @@ function showWhoToFollow(panel, reply) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWhoToFollow(panel) {
|
function getWhoToFollow() {
|
||||||
const credentials = panel.$useUsersStore().currentUser.credentials
|
const credentials = useOAuthStore().token
|
||||||
if (credentials) {
|
if (credentials) {
|
||||||
panel.usersToFollow.forEach((toFollow) => {
|
panel.usersToFollow.forEach((toFollow) => {
|
||||||
toFollow.name = 'Loading...'
|
toFollow.name = 'Loading...'
|
||||||
|
|
@ -66,7 +66,7 @@ const WhoToFollowPanel = {
|
||||||
watch: {
|
watch: {
|
||||||
user: function () {
|
user: function () {
|
||||||
if (this.suggestionsEnabled) {
|
if (this.suggestionsEnabled) {
|
||||||
getWhoToFollow(this)
|
getWhoToFollow()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -77,7 +77,7 @@ const WhoToFollowPanel = {
|
||||||
id: 0,
|
id: 0,
|
||||||
}))
|
}))
|
||||||
if (this.suggestionsEnabled) {
|
if (this.suggestionsEnabled) {
|
||||||
getWhoToFollow(this)
|
getWhoToFollow()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import { map } from 'lodash'
|
||||||
|
|
||||||
import { useStatusesStore } from 'src/stores/statuses.js'
|
import { useStatusesStore } from 'src/stores/statuses.js'
|
||||||
import { useTimelinesStore } from 'src/stores/timelines.js'
|
import { useTimelinesStore } from 'src/stores/timelines.js'
|
||||||
import { useUsersStore } from 'src/stores/users.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
editStatus as apiEditStatus,
|
editStatus as apiEditStatus,
|
||||||
|
|
@ -28,7 +28,7 @@ const postStatus = ({
|
||||||
const mediaIds = map(media, 'id')
|
const mediaIds = map(media, 'id')
|
||||||
|
|
||||||
return apiPostStatus({
|
return apiPostStatus({
|
||||||
credentials: useUsersStore().currentUser.credentials,
|
credentials: useOAuthStore().token
|
||||||
status,
|
status,
|
||||||
spoilerText,
|
spoilerText,
|
||||||
visibility,
|
visibility,
|
||||||
|
|
@ -71,7 +71,7 @@ const editStatus = ({
|
||||||
|
|
||||||
return apiEditStatus({
|
return apiEditStatus({
|
||||||
id: statusId,
|
id: statusId,
|
||||||
credentials: useUsersStore().currentUser.credentials,
|
credentials: useOAuthStore().token
|
||||||
status,
|
status,
|
||||||
spoilerText,
|
spoilerText,
|
||||||
sensitive,
|
sensitive,
|
||||||
|
|
@ -101,12 +101,12 @@ const editStatus = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
const uploadMedia = ({ store, formData }) => {
|
const uploadMedia = ({ store, formData }) => {
|
||||||
const credentials = useUsersStore().currentUser.credentials
|
const credentials = useOAuthStore().token
|
||||||
return apiUploadMedia({ credentials, formData }).then(({ data }) => data)
|
return apiUploadMedia({ credentials, formData }).then(({ data }) => data)
|
||||||
}
|
}
|
||||||
|
|
||||||
const setMediaDescription = ({ store, id, description }) => {
|
const setMediaDescription = ({ store, id, description }) => {
|
||||||
const credentials = useUsersStore().currentUser.credentials
|
const credentials = useOAuthStore().token
|
||||||
return apiSetMediaDescription({ credentials, id, description }).then(
|
return apiSetMediaDescription({ credentials, id, description }).then(
|
||||||
({ data }) => data,
|
({ data }) => data,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import {
|
||||||
|
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
import { useUsersStore } from 'src/stores/users.js'
|
import { useUsersStore } from 'src/stores/users.js'
|
||||||
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import { fetchKnownDomains } from 'src/api/public.js'
|
import { fetchKnownDomains } from 'src/api/public.js'
|
||||||
|
|
||||||
|
|
@ -213,7 +214,7 @@ export const useInstanceStore = defineStore('instance', {
|
||||||
async getKnownDomains() {
|
async getKnownDomains() {
|
||||||
try {
|
try {
|
||||||
const { data } = await fetchKnownDomains({
|
const { data } = await fetchKnownDomains({
|
||||||
credentials: useUsersStore().currentUser.credentials,
|
credentials: useOAuthStore().token
|
||||||
})
|
})
|
||||||
this.knownDomains = data
|
this.knownDomains = data
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
||||||
|
|
@ -854,7 +854,7 @@ export const useInterfaceStore = defineStore('interface', {
|
||||||
},
|
},
|
||||||
|
|
||||||
unregisterPushNotifications() {
|
unregisterPushNotifications() {
|
||||||
const token = this.currentUser.credentials
|
const token = useOAuthStore().token
|
||||||
|
|
||||||
unregisterPushNotifications(token)
|
unregisterPushNotifications(token)
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue