use OAuthStore directly

This commit is contained in:
Henry Jameson 2026-06-16 17:32:26 +03:00
commit 3984a5aefa
44 changed files with 226 additions and 256 deletions

View file

@ -6,7 +6,8 @@ const REPORTS = '/api/v1/pleroma/admin/reports'
const CONFIG_URL = '/api/v1/pleroma/admin/config'
const DESCRIPTIONS_URL = '/api/v1/pleroma/admin/config/descriptions'
const ANNOUNCEMENTS_URL = (id = '') => `/api/v1/pleroma/admin/announcements/${id}`
const ANNOUNCEMENTS_URL = (id = '') =>
`/api/v1/pleroma/admin/announcements/${id}`
const FRONTENDS_URL = '/api/v1/pleroma/admin/frontends'
const FRONTENDS_INSTALL_URL = '/api/v1/pleroma/admin/frontends/install'

View file

@ -1,4 +1,4 @@
import { useCredentialsStore } from 'src/stores/credentials.js'
import { useOAuthStore } from 'src/stores/oauth.js'
import {
fetchUserRelationship,
@ -11,7 +11,7 @@ const fetchRelationship = (attempt, userId, store) =>
setTimeout(() => {
fetchUserRelationship({
id: userId,
credentials: useCredentialsStore().current,
credentials: useOAuthStore().token,
})
.then((relationship) => {
store.commit('updateUserRelationship', [relationship])
@ -39,7 +39,7 @@ export const requestFollow = (userId, store) =>
new Promise((resolve) => {
followUser({
id: userId,
credentials: useCredentialsStore().current,
credentials: useOAuthStore().token,
}).then((updated) => {
store.commit('updateUserRelationship', [updated])
@ -66,7 +66,7 @@ export const requestUnfollow = (userId, store) =>
new Promise((resolve) => {
unfollowUser({
id: userId,
credentials: useCredentialsStore().current,
credentials: useOAuthStore().token,
}).then((updated) => {
store.commit('updateUserRelationship', [updated])
resolve({

View file

@ -6,9 +6,10 @@
const wait = (timeout) => {
let timeoutId
const promise = () => new Promise((resolve) => {
timeoutId = window.setTimeout(() => resolve(), timeout)
})
const promise = () =>
new Promise((resolve) => {
timeoutId = window.setTimeout(() => resolve(), timeout)
})
return { timeoutId, promise }
}