use OAuthStore directly
This commit is contained in:
parent
529a2d100b
commit
3984a5aefa
44 changed files with 226 additions and 256 deletions
|
|
@ -30,7 +30,6 @@ import routes from './routes'
|
||||||
|
|
||||||
import { useAnnouncementsStore } from 'src/stores/announcements'
|
import { useAnnouncementsStore } from 'src/stores/announcements'
|
||||||
import { useAuthFlowStore } from 'src/stores/auth_flow'
|
import { useAuthFlowStore } from 'src/stores/auth_flow'
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
|
||||||
import { useEmojiStore } from 'src/stores/emoji.js'
|
import { useEmojiStore } from 'src/stores/emoji.js'
|
||||||
import { useI18nStore } from 'src/stores/i18n'
|
import { useI18nStore } from 'src/stores/i18n'
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
|
@ -38,7 +37,7 @@ import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.j
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
import { useLocalConfigStore } from 'src/stores/local_config.js'
|
import { useLocalConfigStore } from 'src/stores/local_config.js'
|
||||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||||
import { useOAuthStore } from 'src/stores/oauth'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||||
import { useUserHighlightStore } from 'src/stores/user_highlight.js'
|
import { useUserHighlightStore } from 'src/stores/user_highlight.js'
|
||||||
|
|
||||||
|
|
@ -261,13 +260,6 @@ const getStickers = async ({ store }) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const getAppSecret = async ({ store }) => {
|
|
||||||
const oauth = useOAuthStore()
|
|
||||||
if (oauth.userToken) {
|
|
||||||
useCredentialsStore().setCredentials(oauth.getToken)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const resolveStaffAccounts = ({ store, accounts }) => {
|
const resolveStaffAccounts = ({ store, accounts }) => {
|
||||||
const nicknames = accounts.map((uri) => uri.split('/').pop())
|
const nicknames = accounts.map((uri) => uri.split('/').pop())
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
|
|
@ -458,14 +450,13 @@ const setConfig = async ({ store }) => {
|
||||||
const apiConfig = configInfos[0]
|
const apiConfig = configInfos[0]
|
||||||
const staticConfig = configInfos[1]
|
const staticConfig = configInfos[1]
|
||||||
|
|
||||||
getAppSecret({ store })
|
|
||||||
await setSettings({ store, apiConfig, staticConfig })
|
await setSettings({ store, apiConfig, staticConfig })
|
||||||
}
|
}
|
||||||
|
|
||||||
const checkOAuthToken = async ({ store }) => {
|
const checkOAuthToken = async ({ store }) => {
|
||||||
const oauth = useOAuthStore()
|
const oauth = useOAuthStore()
|
||||||
if (oauth.getUserToken) {
|
if (oauth.userToken) {
|
||||||
return store.dispatch('loginUser', oauth.getUserToken)
|
return store.dispatch('loginUser', oauth.userToken)
|
||||||
}
|
}
|
||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import EmojiPicker from 'src/components/emoji_picker/emoji_picker.vue'
|
import EmojiPicker from 'src/components/emoji_picker/emoji_picker.vue'
|
||||||
|
|
||||||
import { useBookmarkFoldersStore } from 'src/stores/bookmark_folders.js'
|
import { useBookmarkFoldersStore } from 'src/stores/bookmark_folders.js'
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import { fetchBookmarkFolders } from 'src/services/api/api.service.js'
|
import { fetchBookmarkFolders } from 'src/services/api/api.service.js'
|
||||||
|
|
||||||
|
|
@ -26,7 +26,7 @@ const BookmarkFolderEdit = {
|
||||||
if (!this.id) return
|
if (!this.id) return
|
||||||
|
|
||||||
fetchBookmarkFolders({
|
fetchBookmarkFolders({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((folders) => {
|
}).then((folders) => {
|
||||||
const folder = folders.find((folder) => folder.id === this.id)
|
const folder = folders.find((folder) => folder.id === this.id)
|
||||||
if (!folder) return
|
if (!folder) return
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@ import {
|
||||||
isScrollable,
|
isScrollable,
|
||||||
} from './chat_layout_utils.js'
|
} from './chat_layout_utils.js'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
chatMessages,
|
chatMessages,
|
||||||
|
|
@ -277,7 +277,7 @@ const Chat = {
|
||||||
id: chatId,
|
id: chatId,
|
||||||
maxId,
|
maxId,
|
||||||
sinceId,
|
sinceId,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((messages) => {
|
}).then((messages) => {
|
||||||
// Clear the current chat in case we're recovering from a ws connection loss.
|
// Clear the current chat in case we're recovering from a ws connection loss.
|
||||||
if (isFirstFetch) {
|
if (isFirstFetch) {
|
||||||
|
|
@ -312,7 +312,7 @@ const Chat = {
|
||||||
try {
|
try {
|
||||||
chat = await getOrCreateChat({
|
chat = await getOrCreateChat({
|
||||||
accountId: this.recipientId,
|
accountId: this.recipientId,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Error creating or getting a chat', e)
|
console.error('Error creating or getting a chat', e)
|
||||||
|
|
@ -381,7 +381,7 @@ const Chat = {
|
||||||
|
|
||||||
sendChatMessage({
|
sendChatMessage({
|
||||||
params,
|
params,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
this.$store.dispatch('addChatMessages', {
|
this.$store.dispatch('addChatMessages', {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { mapGetters, mapState } from 'vuex'
|
||||||
import BasicUserCard from 'src/components/basic_user_card/basic_user_card.vue'
|
import BasicUserCard from 'src/components/basic_user_card/basic_user_card.vue'
|
||||||
import UserAvatar from 'src/components/user_avatar/user_avatar.vue'
|
import UserAvatar from 'src/components/user_avatar/user_avatar.vue'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import { chats } from 'src/services/api/api.service.js'
|
import { chats } from 'src/services/api/api.service.js'
|
||||||
|
|
||||||
|
|
@ -27,7 +27,7 @@ const chatNew = {
|
||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
const { chats } = await chats({
|
const { chats } = await chats({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
chats.forEach((chat) => this.suggestions.push(chat.account))
|
chats.forEach((chat) => this.suggestions.push(chat.account))
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@ import QuickViewSettings from 'src/components/quick_view_settings/quick_view_set
|
||||||
import ThreadTree from 'src/components/thread_tree/thread_tree.vue'
|
import ThreadTree from 'src/components/thread_tree/thread_tree.vue'
|
||||||
import { WSConnectionStatus } from '../../services/api/api.service.js'
|
import { WSConnectionStatus } from '../../services/api/api.service.js'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
|
||||||
import { useInterfaceStore } from 'src/stores/interface'
|
import { useInterfaceStore } from 'src/stores/interface'
|
||||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||||
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import { fetchConversation, fetchStatus } from 'src/services/api/api.service.js'
|
import { fetchConversation, fetchStatus } from 'src/services/api/api.service.js'
|
||||||
|
|
||||||
|
|
@ -441,7 +441,7 @@ const conversation = {
|
||||||
if (this.status) {
|
if (this.status) {
|
||||||
fetchConversation({
|
fetchConversation({
|
||||||
id: this.statusId,
|
id: this.statusId,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then(({ ancestors, descendants }) => {
|
}).then(({ ancestors, descendants }) => {
|
||||||
this.$store.dispatch('addNewStatuses', { statuses: ancestors })
|
this.$store.dispatch('addNewStatuses', { statuses: ancestors })
|
||||||
this.$store.dispatch('addNewStatuses', { statuses: descendants })
|
this.$store.dispatch('addNewStatuses', { statuses: descendants })
|
||||||
|
|
@ -451,13 +451,14 @@ const conversation = {
|
||||||
this.loadStatusError = null
|
this.loadStatusError = null
|
||||||
fetchStatus({
|
fetchStatus({
|
||||||
id: this.statusId,
|
id: this.statusId,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
.then((status) => {
|
.then((status) => {
|
||||||
this.$store.dispatch('addNewStatuses', { statuses: [status] })
|
this.$store.dispatch('addNewStatuses', { statuses: [status] })
|
||||||
this.fetchConversation()
|
this.fetchConversation()
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
console.error(error)
|
||||||
this.loadStatusError = error
|
this.loadStatusError = error
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ import { defineAsyncComponent } from 'vue'
|
||||||
import { notificationsFromStore } from '../../services/notification_utils/notification_utils.js'
|
import { notificationsFromStore } from '../../services/notification_utils/notification_utils.js'
|
||||||
import BasicUserCard from '../basic_user_card/basic_user_card.vue'
|
import BasicUserCard from '../basic_user_card/basic_user_card.vue'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
|
||||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||||
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import { approveUser, denyUser } from 'src/services/api/api.service.js'
|
import { approveUser, denyUser } from 'src/services/api/api.service.js'
|
||||||
|
|
||||||
|
|
@ -53,7 +53,7 @@ const FollowRequestCard = {
|
||||||
doApprove() {
|
doApprove() {
|
||||||
approveUser({
|
approveUser({
|
||||||
id: this.user.id,
|
id: this.user.id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
this.$store.dispatch('removeFollowRequest', this.user)
|
this.$store.dispatch('removeFollowRequest', this.user)
|
||||||
|
|
||||||
|
|
@ -79,7 +79,7 @@ const FollowRequestCard = {
|
||||||
|
|
||||||
denyUser({
|
denyUser({
|
||||||
id: this.user.id,
|
id: this.user.id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$store.dispatch('dismissNotificationLocal', { id: notifId })
|
this.$store.dispatch('dismissNotificationLocal', { id: notifId })
|
||||||
this.$store.dispatch('removeFollowRequest', this.user)
|
this.$store.dispatch('removeFollowRequest', this.user)
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,9 @@ import {
|
||||||
highlightStyle,
|
highlightStyle,
|
||||||
} from '../../services/user_highlighter/user_highlighter.js'
|
} from '../../services/user_highlighter/user_highlighter.js'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||||
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
import { useUserHighlightStore } from 'src/stores/user_highlight.js'
|
import { useUserHighlightStore } from 'src/stores/user_highlight.js'
|
||||||
|
|
||||||
import { approveUser, denyUser } from 'src/services/api/api.service.js'
|
import { approveUser, denyUser } from 'src/services/api/api.service.js'
|
||||||
|
|
@ -146,7 +146,7 @@ const Notification = {
|
||||||
doApprove() {
|
doApprove() {
|
||||||
approveUser({
|
approveUser({
|
||||||
id: this.user.id,
|
id: this.user.id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
this.$store.dispatch('removeFollowRequest', this.user)
|
this.$store.dispatch('removeFollowRequest', this.user)
|
||||||
this.$store.dispatch('markSingleNotificationAsSeen', {
|
this.$store.dispatch('markSingleNotificationAsSeen', {
|
||||||
|
|
@ -170,7 +170,7 @@ const Notification = {
|
||||||
doDeny() {
|
doDeny() {
|
||||||
denyUser({
|
denyUser({
|
||||||
id: this.user.id,
|
id: this.user.id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$store.dispatch('dismissNotificationLocal', {
|
this.$store.dispatch('dismissNotificationLocal', {
|
||||||
id: this.notification.id,
|
id: this.notification.id,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import { fetchUser } from 'src/services/api/api.service.js'
|
import { fetchUser } from 'src/services/api/api.service.js'
|
||||||
|
|
||||||
|
|
@ -14,7 +14,7 @@ const RemoteUserResolver = {
|
||||||
const id = this.$route.params.username + '@' + this.$route.params.hostname
|
const id = this.$route.params.username + '@' + this.$route.params.hostname
|
||||||
fetchUser({
|
fetchUser({
|
||||||
id,
|
id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
.then((externalUser) => {
|
.then((externalUser) => {
|
||||||
if (externalUser.error) {
|
if (externalUser.error) {
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@ import Popover from 'components/popover/popover.vue'
|
||||||
import SelectComponent from 'components/select/select.vue'
|
import SelectComponent from 'components/select/select.vue'
|
||||||
import { defineAsyncComponent } from 'vue'
|
import { defineAsyncComponent } from 'vue'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
addNewEmojiFile,
|
addNewEmojiFile,
|
||||||
|
|
@ -257,7 +257,7 @@ export default {
|
||||||
newShortcode: this.editedShortcode,
|
newShortcode: this.editedShortcode,
|
||||||
newFilename: this.editedFile,
|
newFilename: this.editedFile,
|
||||||
force: false,
|
force: false,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
.then((resp) => {
|
.then((resp) => {
|
||||||
if (resp.error !== undefined) {
|
if (resp.error !== undefined) {
|
||||||
|
|
@ -281,7 +281,7 @@ export default {
|
||||||
: this.emojiAddr(this.file),
|
: this.emojiAddr(this.file),
|
||||||
shortcode: this.editedShortcode,
|
shortcode: this.editedShortcode,
|
||||||
filename: this.editedFile,
|
filename: this.editedFile,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
.then((resp) => resp.json())
|
.then((resp) => resp.json())
|
||||||
.then((resp) => {
|
.then((resp) => {
|
||||||
|
|
@ -308,7 +308,7 @@ export default {
|
||||||
deleteEmojiFile({
|
deleteEmojiFile({
|
||||||
packName: this.packName,
|
packName: this.packName,
|
||||||
shortcode: this.shortcode,
|
shortcode: this.shortcode,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
.then((resp) => resp.json())
|
.then((resp) => resp.json())
|
||||||
.then((resp) => {
|
.then((resp) => {
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,9 @@ import SharedComputedObject from '../helpers/shared_computed_object.js'
|
||||||
import UnitSetting from '../helpers/unit_setting.vue'
|
import UnitSetting from '../helpers/unit_setting.vue'
|
||||||
import Preview from './old_theme_tab/theme_preview.vue'
|
import Preview from './old_theme_tab/theme_preview.vue'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { normalizeThemeData, useInterfaceStore } from 'src/stores/interface.js'
|
import { normalizeThemeData, useInterfaceStore } from 'src/stores/interface.js'
|
||||||
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import { updateProfileImages } from 'src/services/api/api.service.js'
|
import { updateProfileImages } from 'src/services/api/api.service.js'
|
||||||
import { newImporter } from 'src/services/export_import/export_import.js'
|
import { newImporter } from 'src/services/export_import/export_import.js'
|
||||||
|
|
@ -488,7 +488,7 @@ const AppearanceTab = {
|
||||||
this.backgroundUploading = true
|
this.backgroundUploading = true
|
||||||
updateProfileImages({
|
updateProfileImages({
|
||||||
background,
|
background,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
this.$store.commit('addNewUsers', [data])
|
this.$store.commit('addNewUsers', [data])
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,10 @@ import IntegerSetting from '../helpers/integer_setting.vue'
|
||||||
import SharedComputedObject from '../helpers/shared_computed_object.js'
|
import SharedComputedObject from '../helpers/shared_computed_object.js'
|
||||||
import UnitSetting from '../helpers/unit_setting.vue'
|
import UnitSetting from '../helpers/unit_setting.vue'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||||
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||||
|
|
||||||
import { updateProfile } from 'src/services/api/api.service.js'
|
import { updateProfile } from 'src/services/api/api.service.js'
|
||||||
|
|
@ -168,7 +168,7 @@ const ComposingTab = {
|
||||||
|
|
||||||
updateProfile({
|
updateProfile({
|
||||||
params,
|
params,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((user) => {
|
}).then((user) => {
|
||||||
this.$store.commit('addNewUsers', [user])
|
this.$store.commit('addNewUsers', [user])
|
||||||
this.$store.commit('setCurrentUser', user)
|
this.$store.commit('setCurrentUser', user)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import Checkbox from 'src/components/checkbox/checkbox.vue'
|
||||||
import Exporter from 'src/components/exporter/exporter.vue'
|
import Exporter from 'src/components/exporter/exporter.vue'
|
||||||
import Importer from 'src/components/importer/importer.vue'
|
import Importer from 'src/components/importer/importer.vue'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
import { useOAuthTokensStore } from 'src/stores/oauth_tokens.js'
|
import { useOAuthTokensStore } from 'src/stores/oauth_tokens.js'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
|
@ -47,23 +47,23 @@ const DataImportExportTab = {
|
||||||
getFollowsContent() {
|
getFollowsContent() {
|
||||||
return exportFriends({
|
return exportFriends({
|
||||||
id: this.user.id,
|
id: this.user.id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then(this.generateExportableUsersContent)
|
}).then(this.generateExportableUsersContent)
|
||||||
},
|
},
|
||||||
getBlocksContent() {
|
getBlocksContent() {
|
||||||
return fetchBlocks({
|
return fetchBlocks({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then(this.generateExportableUsersContent)
|
}).then(this.generateExportableUsersContent)
|
||||||
},
|
},
|
||||||
getMutesContent() {
|
getMutesContent() {
|
||||||
return fetchMutes({
|
return fetchMutes({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then(this.generateExportableUsersContent)
|
}).then(this.generateExportableUsersContent)
|
||||||
},
|
},
|
||||||
importFollows(file) {
|
importFollows(file) {
|
||||||
return importFollows({
|
return importFollows({
|
||||||
file,
|
file,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((status) => {
|
}).then((status) => {
|
||||||
if (!status) {
|
if (!status) {
|
||||||
throw new Error('failed')
|
throw new Error('failed')
|
||||||
|
|
@ -73,7 +73,7 @@ const DataImportExportTab = {
|
||||||
importBlocks(file) {
|
importBlocks(file) {
|
||||||
return importBlocks({
|
return importBlocks({
|
||||||
file,
|
file,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((status) => {
|
}).then((status) => {
|
||||||
if (!status) {
|
if (!status) {
|
||||||
throw new Error('failed')
|
throw new Error('failed')
|
||||||
|
|
@ -83,7 +83,7 @@ const DataImportExportTab = {
|
||||||
importMutes(file) {
|
importMutes(file) {
|
||||||
return importMutes({
|
return importMutes({
|
||||||
file,
|
file,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((status) => {
|
}).then((status) => {
|
||||||
if (!status) {
|
if (!status) {
|
||||||
throw new Error('failed')
|
throw new Error('failed')
|
||||||
|
|
@ -105,7 +105,7 @@ const DataImportExportTab = {
|
||||||
},
|
},
|
||||||
addBackup() {
|
addBackup() {
|
||||||
addBackup({
|
addBackup({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.addedBackup = true
|
this.addedBackup = true
|
||||||
|
|
@ -119,7 +119,7 @@ const DataImportExportTab = {
|
||||||
},
|
},
|
||||||
fetchBackups() {
|
fetchBackups() {
|
||||||
listBackups({
|
listBackups({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
this.backups = res
|
this.backups = res
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,11 @@ import FloatSetting from '../helpers/float_setting.vue'
|
||||||
import SharedComputedObject from '../helpers/shared_computed_object.js'
|
import SharedComputedObject from '../helpers/shared_computed_object.js'
|
||||||
import UnitSetting from '../helpers/unit_setting.vue'
|
import UnitSetting from '../helpers/unit_setting.vue'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useLocalConfigStore } from 'src/stores/local_config.js'
|
import { useLocalConfigStore } from 'src/stores/local_config.js'
|
||||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||||
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||||
|
|
||||||
import { updateProfile } from 'src/services/api/api.service.js'
|
import { updateProfile } from 'src/services/api/api.service.js'
|
||||||
|
|
@ -62,7 +62,7 @@ const GeneralTab = {
|
||||||
|
|
||||||
updateProfile({
|
updateProfile({
|
||||||
params,
|
params,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((user) => {
|
}).then((user) => {
|
||||||
this.$store.commit('addNewUsers', [user])
|
this.$store.commit('addNewUsers', [user])
|
||||||
this.$store.commit('setCurrentUser', user)
|
this.$store.commit('setCurrentUser', user)
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ import MuteCard from 'src/components/mute_card/mute_card.vue'
|
||||||
import ProgressButton from 'src/components/progress_button/progress_button.vue'
|
import ProgressButton from 'src/components/progress_button/progress_button.vue'
|
||||||
import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx'
|
import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
import { useOAuthTokensStore } from 'src/stores/oauth_tokens.js'
|
import { useOAuthTokensStore } from 'src/stores/oauth_tokens.js'
|
||||||
|
|
||||||
import { importBlocks, importFollows } from 'src/services/api/api.service.js'
|
import { importBlocks, importFollows } from 'src/services/api/api.service.js'
|
||||||
|
|
@ -59,7 +59,7 @@ const MutesAndBlocks = {
|
||||||
importFollows(file) {
|
importFollows(file) {
|
||||||
return importFollows({
|
return importFollows({
|
||||||
file,
|
file,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((status) => {
|
}).then((status) => {
|
||||||
if (!status) {
|
if (!status) {
|
||||||
throw new Error('failed')
|
throw new Error('failed')
|
||||||
|
|
@ -69,7 +69,7 @@ const MutesAndBlocks = {
|
||||||
importBlocks(file) {
|
importBlocks(file) {
|
||||||
return importBlocks({
|
return importBlocks({
|
||||||
file,
|
file,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((status) => {
|
}).then((status) => {
|
||||||
if (!status) {
|
if (!status) {
|
||||||
throw new Error('failed')
|
throw new Error('failed')
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import BooleanSetting from '../helpers/boolean_setting.vue'
|
import BooleanSetting from '../helpers/boolean_setting.vue'
|
||||||
import SharedComputedObject from '../helpers/shared_computed_object.js'
|
import SharedComputedObject from '../helpers/shared_computed_object.js'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import { updateNotificationSettings } from 'src/services/api/api.service.js'
|
import { updateNotificationSettings } from 'src/services/api/api.service.js'
|
||||||
|
|
||||||
|
|
@ -32,7 +32,7 @@ const NotificationsTab = {
|
||||||
methods: {
|
methods: {
|
||||||
updateNotificationSettings() {
|
updateNotificationSettings() {
|
||||||
updateNotificationSettings({
|
updateNotificationSettings({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
settings: this.notificationSettings,
|
settings: this.notificationSettings,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import UserCard from 'src/components/user_card/user_card.vue'
|
||||||
import BooleanSetting from '../helpers/boolean_setting.vue'
|
import BooleanSetting from '../helpers/boolean_setting.vue'
|
||||||
import SharedComputedObject from '../helpers/shared_computed_object.js'
|
import SharedComputedObject from '../helpers/shared_computed_object.js'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import { updateProfile } from 'src/services/api/api.service.js'
|
import { updateProfile } from 'src/services/api/api.service.js'
|
||||||
|
|
||||||
|
|
@ -41,7 +41,7 @@ const ProfileTab = {
|
||||||
}
|
}
|
||||||
updateProfile({
|
updateProfile({
|
||||||
params,
|
params,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
.then((user) => {
|
.then((user) => {
|
||||||
this.$store.commit('addNewUsers', [user])
|
this.$store.commit('addNewUsers', [user])
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import Confirm from './confirm.vue'
|
||||||
import RecoveryCodes from './mfa_backup_codes.vue'
|
import RecoveryCodes from './mfa_backup_codes.vue'
|
||||||
import TOTP from './mfa_totp.vue'
|
import TOTP from './mfa_totp.vue'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
generateMfaBackupCodes,
|
generateMfaBackupCodes,
|
||||||
|
|
@ -94,7 +94,7 @@ const Mfa = {
|
||||||
this.backupCodes.codes = []
|
this.backupCodes.codes = []
|
||||||
|
|
||||||
return generateMfaBackupCodes({
|
return generateMfaBackupCodes({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
this.backupCodes.codes = res.codes
|
this.backupCodes.codes = res.codes
|
||||||
this.backupCodes.inProgress = false
|
this.backupCodes.inProgress = false
|
||||||
|
|
@ -121,7 +121,7 @@ const Mfa = {
|
||||||
this.setupState.state = 'setupOTP'
|
this.setupState.state = 'setupOTP'
|
||||||
this.setupState.setupOTPState = 'prepare'
|
this.setupState.setupOTPState = 'prepare'
|
||||||
mfaSetupOTP({
|
mfaSetupOTP({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
this.otpSettings = res
|
this.otpSettings = res
|
||||||
this.setupState.setupOTPState = 'confirm'
|
this.setupState.setupOTPState = 'confirm'
|
||||||
|
|
@ -133,7 +133,7 @@ const Mfa = {
|
||||||
mfaConfirmOTP({
|
mfaConfirmOTP({
|
||||||
token: this.otpConfirmToken,
|
token: this.otpConfirmToken,
|
||||||
password: this.currentPassword,
|
password: this.currentPassword,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
this.error = res.error
|
this.error = res.error
|
||||||
|
|
@ -162,7 +162,7 @@ const Mfa = {
|
||||||
// fetch settings from server
|
// fetch settings from server
|
||||||
async fetchSettings() {
|
async fetchSettings() {
|
||||||
const result = await settingsMFA({
|
const result = await settingsMFA({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
if (result.error) return
|
if (result.error) return
|
||||||
this.settings = result.settings
|
this.settings = result.settings
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import { mapState } from 'vuex'
|
||||||
|
|
||||||
import Confirm from './confirm.vue'
|
import Confirm from './confirm.vue'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import { mfaDisableOTP } from 'src/services/api/api.service.js'
|
import { mfaDisableOTP } from 'src/services/api/api.service.js'
|
||||||
|
|
||||||
|
|
@ -39,7 +39,7 @@ export default {
|
||||||
this.inProgress = true
|
this.inProgress = true
|
||||||
mfaDisableOTP({
|
mfaDisableOTP({
|
||||||
password: this.currentPassword,
|
password: this.currentPassword,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
this.inProgress = false
|
this.inProgress = false
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@ import Checkbox from 'src/components/checkbox/checkbox.vue'
|
||||||
import ProgressButton from 'src/components/progress_button/progress_button.vue'
|
import ProgressButton from 'src/components/progress_button/progress_button.vue'
|
||||||
import Mfa from './mfa.vue'
|
import Mfa from './mfa.vue'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
import { useOAuthTokensStore } from 'src/stores/oauth_tokens'
|
import { useOAuthTokensStore } from 'src/stores/oauth_tokens'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
|
@ -76,7 +76,7 @@ const SecurityTab = {
|
||||||
},
|
},
|
||||||
deleteAccount() {
|
deleteAccount() {
|
||||||
deleteAccount({
|
deleteAccount({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
password: this.deleteAccountConfirmPasswordInput,
|
password: this.deleteAccountConfirmPasswordInput,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.status === 'success') {
|
if (res.status === 'success') {
|
||||||
|
|
@ -92,7 +92,7 @@ const SecurityTab = {
|
||||||
password: this.changePasswordInputs[0],
|
password: this.changePasswordInputs[0],
|
||||||
newPassword: this.changePasswordInputs[1],
|
newPassword: this.changePasswordInputs[1],
|
||||||
newPasswordConfirmation: this.changePasswordInputs[2],
|
newPasswordConfirmation: this.changePasswordInputs[2],
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}
|
}
|
||||||
changePassword(params).then((res) => {
|
changePassword(params).then((res) => {
|
||||||
if (res.status === 'success') {
|
if (res.status === 'success') {
|
||||||
|
|
@ -109,7 +109,7 @@ const SecurityTab = {
|
||||||
const params = {
|
const params = {
|
||||||
email: this.newEmail,
|
email: this.newEmail,
|
||||||
password: this.changeEmailPassword,
|
password: this.changeEmailPassword,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}
|
}
|
||||||
changeEmail(params).then((res) => {
|
changeEmail(params).then((res) => {
|
||||||
if (res.status === 'success') {
|
if (res.status === 'success') {
|
||||||
|
|
@ -125,7 +125,7 @@ const SecurityTab = {
|
||||||
const params = {
|
const params = {
|
||||||
targetAccount: this.moveAccountTarget,
|
targetAccount: this.moveAccountTarget,
|
||||||
password: this.moveAccountPassword,
|
password: this.moveAccountPassword,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}
|
}
|
||||||
moveAccount(params).then((res) => {
|
moveAccount(params).then((res) => {
|
||||||
if (res.status === 'success') {
|
if (res.status === 'success') {
|
||||||
|
|
@ -140,13 +140,13 @@ const SecurityTab = {
|
||||||
removeAlias(alias) {
|
removeAlias(alias) {
|
||||||
deleteAlias({
|
deleteAlias({
|
||||||
alias,
|
alias,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then(() => this.fetchAliases())
|
}).then(() => this.fetchAliases())
|
||||||
},
|
},
|
||||||
addAlias() {
|
addAlias() {
|
||||||
addAlias({
|
addAlias({
|
||||||
alias: this.addAliasTarget,
|
alias: this.addAliasTarget,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.addedAlias = true
|
this.addedAlias = true
|
||||||
|
|
@ -161,7 +161,7 @@ const SecurityTab = {
|
||||||
},
|
},
|
||||||
fetchAliases() {
|
fetchAliases() {
|
||||||
listAliases({
|
listAliases({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
this.aliases = res.aliases
|
this.aliases = res.aliases
|
||||||
|
|
|
||||||
|
|
@ -16,13 +16,13 @@ import Select from 'src/components/select/select.vue'
|
||||||
import UserAvatar from 'src/components/user_avatar/user_avatar.vue'
|
import UserAvatar from 'src/components/user_avatar/user_avatar.vue'
|
||||||
import UserLink from 'src/components/user_link/user_link.vue'
|
import UserLink from 'src/components/user_link/user_link.vue'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
|
||||||
import { useEmojiStore } from 'src/stores/emoji.js'
|
import { useEmojiStore } from 'src/stores/emoji.js'
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useInterfaceStore } from 'src/stores/interface'
|
import { useInterfaceStore } from 'src/stores/interface'
|
||||||
import { useMediaViewerStore } from 'src/stores/media_viewer'
|
import { useMediaViewerStore } from 'src/stores/media_viewer'
|
||||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||||
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
import { usePostStatusStore } from 'src/stores/post_status'
|
import { usePostStatusStore } from 'src/stores/post_status'
|
||||||
import { useUserHighlightStore } from 'src/stores/user_highlight.js'
|
import { useUserHighlightStore } from 'src/stores/user_highlight.js'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import List from 'src/components/list/list.vue'
|
||||||
import Modal from 'src/components/modal/modal.vue'
|
import Modal from 'src/components/modal/modal.vue'
|
||||||
import UserLink from 'src/components/user_link/user_link.vue'
|
import UserLink from 'src/components/user_link/user_link.vue'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
import { useReportsStore } from 'src/stores/reports.js'
|
import { useReportsStore } from 'src/stores/reports.js'
|
||||||
|
|
||||||
import { reportUser } from 'src/services/api/api.service.js'
|
import { reportUser } from 'src/services/api/api.service.js'
|
||||||
|
|
@ -31,6 +31,7 @@ const UserReportingModal = {
|
||||||
return !!this.$store.state.users.currentUser
|
return !!this.$store.state.users.currentUser
|
||||||
},
|
},
|
||||||
isOpen() {
|
isOpen() {
|
||||||
|
console.log(this.reportModal)
|
||||||
return this.isLoggedIn && this.reportModal.activated
|
return this.isLoggedIn && this.reportModal.activated
|
||||||
},
|
},
|
||||||
userId() {
|
userId() {
|
||||||
|
|
@ -73,7 +74,7 @@ const UserReportingModal = {
|
||||||
comment: this.comment,
|
comment: this.comment,
|
||||||
forward: this.forward,
|
forward: this.forward,
|
||||||
statusIds: [...this.statusIdsToReport],
|
statusIds: [...this.statusIdsToReport],
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}
|
}
|
||||||
reportUser({ ...params })
|
reportUser({ ...params })
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import FollowCard from 'src/components/follow_card/follow_card.vue'
|
import FollowCard from 'src/components/follow_card/follow_card.vue'
|
||||||
import apiService from '../../services/api/api.service.js'
|
import apiService from '../../services/api/api.service.js'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import { fetchUser, suggestions } from 'src/services/api/api.service.js'
|
import { fetchUser, suggestions } from 'src/services/api/api.service.js'
|
||||||
|
|
||||||
|
|
@ -23,7 +23,7 @@ const WhoToFollow = {
|
||||||
reply.forEach(({ id }) => {
|
reply.forEach(({ id }) => {
|
||||||
fetchUser({
|
fetchUser({
|
||||||
id,
|
id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((externalUser) => {
|
}).then((externalUser) => {
|
||||||
if (!externalUser.error) {
|
if (!externalUser.error) {
|
||||||
this.$store.commit('addNewUsers', [externalUser])
|
this.$store.commit('addNewUsers', [externalUser])
|
||||||
|
|
@ -33,7 +33,7 @@ const WhoToFollow = {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getWhoToFollow() {
|
getWhoToFollow() {
|
||||||
const credentials = useCredentialsStore().current
|
const credentials = useOAuthStore().token
|
||||||
if (credentials) {
|
if (credentials) {
|
||||||
suggestions({ credentials }).then((reply) => {
|
suggestions({ credentials }).then((reply) => {
|
||||||
this.showWhoToFollow(reply)
|
this.showWhoToFollow(reply)
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import { shuffle } from 'lodash'
|
import { shuffle } from 'lodash'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import { fetchUser, suggestions } from 'src/services/api/api.service.js'
|
import { fetchUser, suggestions } from 'src/services/api/api.service.js'
|
||||||
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
||||||
|
|
@ -20,7 +20,7 @@ function showWhoToFollow(panel, reply) {
|
||||||
|
|
||||||
fetchUser({
|
fetchUser({
|
||||||
id: name,
|
id: name,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((externalUser) => {
|
}).then((externalUser) => {
|
||||||
if (!externalUser.error) {
|
if (!externalUser.error) {
|
||||||
panel.$store.commit('addNewUsers', [externalUser])
|
panel.$store.commit('addNewUsers', [externalUser])
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,10 @@ import { Socket } from 'phoenix'
|
||||||
import { WSConnectionStatus } from '../services/api/api.service.js'
|
import { WSConnectionStatus } from '../services/api/api.service.js'
|
||||||
import { maybeShowChatNotification } from '../services/chat_utils/chat_utils.js'
|
import { maybeShowChatNotification } from '../services/chat_utils/chat_utils.js'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
import { useShoutStore } from 'src/stores/shout.js'
|
import { useShoutStore } from 'src/stores/shout.js'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
|
@ -98,7 +98,7 @@ const api = {
|
||||||
const timelineData = rootState.statuses.timelines.friends
|
const timelineData = rootState.statuses.timelines.friends
|
||||||
|
|
||||||
const serv = useInstanceStore().server.replace('http', 'ws')
|
const serv = useInstanceStore().server.replace('http', 'ws')
|
||||||
const credentials = useCredentialsStore().current
|
const credentials = useOAuthStore().token
|
||||||
const url = getMastodonSocketURI({ credentials }, serv)
|
const url = getMastodonSocketURI({ credentials }, serv)
|
||||||
|
|
||||||
state.mastoUserSocket = ProcessedWS({
|
state.mastoUserSocket = ProcessedWS({
|
||||||
|
|
@ -266,7 +266,7 @@ const api = {
|
||||||
statusId,
|
statusId,
|
||||||
bookmarkFolderId,
|
bookmarkFolderId,
|
||||||
tag,
|
tag,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
|
|
||||||
store.commit('addFetcher', { fetcherName: timeline, fetcher })
|
store.commit('addFetcher', { fetcherName: timeline, fetcher })
|
||||||
|
|
@ -282,7 +282,7 @@ const api = {
|
||||||
store,
|
store,
|
||||||
timeline,
|
timeline,
|
||||||
...rest,
|
...rest,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -291,7 +291,7 @@ const api = {
|
||||||
if (store.state.fetchers.notifications) return
|
if (store.state.fetchers.notifications) return
|
||||||
const fetcher = notificationsFetcher.startFetching({
|
const fetcher = notificationsFetcher.startFetching({
|
||||||
store,
|
store,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
store.commit('addFetcher', { fetcherName: 'notifications', fetcher })
|
store.commit('addFetcher', { fetcherName: 'notifications', fetcher })
|
||||||
},
|
},
|
||||||
|
|
@ -306,7 +306,7 @@ const api = {
|
||||||
if (store.state.fetchers.followRequests) return
|
if (store.state.fetchers.followRequests) return
|
||||||
const fetcher = followRequestFetcher.startFetchingFollowRequests({
|
const fetcher = followRequestFetcher.startFetchingFollowRequests({
|
||||||
store,
|
store,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
|
|
||||||
store.commit('addFetcher', { fetcherName: 'followRequests', fetcher })
|
store.commit('addFetcher', { fetcherName: 'followRequests', fetcher })
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import {
|
||||||
} from '../services/entity_normalizer/entity_normalizer.service.js'
|
} from '../services/entity_normalizer/entity_normalizer.service.js'
|
||||||
import { promiseInterval } from '../services/promise_interval/promise_interval.js'
|
import { promiseInterval } from '../services/promise_interval/promise_interval.js'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
chats,
|
chats,
|
||||||
|
|
@ -68,7 +68,7 @@ const chatsModule = {
|
||||||
},
|
},
|
||||||
fetchChats({ dispatch, rootState }) {
|
fetchChats({ dispatch, rootState }) {
|
||||||
return chats({
|
return chats({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then(({ chatList }) => {
|
}).then(({ chatList }) => {
|
||||||
dispatch('addNewChats', { chats: chatList })
|
dispatch('addNewChats', { chats: chatList })
|
||||||
return chats
|
return chats
|
||||||
|
|
@ -125,14 +125,14 @@ const chatsModule = {
|
||||||
readChat({
|
readChat({
|
||||||
id,
|
id,
|
||||||
lastReadId,
|
lastReadId,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deleteChatMessage({ rootState, commit }, value) {
|
deleteChatMessage({ rootState, commit }, value) {
|
||||||
deleteChatMessage({
|
deleteChatMessage({
|
||||||
...value,
|
...value,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
commit('deleteChatMessage', { commit, ...value })
|
commit('deleteChatMessage', { commit, ...value })
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,9 @@ import {
|
||||||
maybeShowNotification,
|
maybeShowNotification,
|
||||||
} from '../services/notification_utils/notification_utils.js'
|
} from '../services/notification_utils/notification_utils.js'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
|
||||||
import { useI18nStore } from 'src/stores/i18n.js'
|
import { useI18nStore } from 'src/stores/i18n.js'
|
||||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||||
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
import { useReportsStore } from 'src/stores/reports.js'
|
import { useReportsStore } from 'src/stores/reports.js'
|
||||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||||
|
|
||||||
|
|
@ -181,7 +181,7 @@ export const notifications = {
|
||||||
commit('dismissNotification', { id })
|
commit('dismissNotification', { id })
|
||||||
dismissNotification({
|
dismissNotification({
|
||||||
id,
|
id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
updateNotification({ commit }, { id, updater }) {
|
updateNotification({ commit }, { id, updater }) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { get, set } from 'lodash'
|
import { get, set } from 'lodash'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
updateNotificationSettings,
|
updateNotificationSettings,
|
||||||
|
|
@ -12,7 +12,7 @@ const defaultApi = ({ rootState, commit }, { path, value }) => {
|
||||||
set(params, path, value)
|
set(params, path, value)
|
||||||
return updateProfile({
|
return updateProfile({
|
||||||
params,
|
params,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
commit('addNewUsers', [result])
|
commit('addNewUsers', [result])
|
||||||
commit('setCurrentUser', result)
|
commit('setCurrentUser', result)
|
||||||
|
|
@ -24,7 +24,7 @@ const notificationsApi = ({ rootState, commit }, { path, value, oldValue }) => {
|
||||||
set(settings, path, value)
|
set(settings, path, value)
|
||||||
return updateNotificationSettings({
|
return updateNotificationSettings({
|
||||||
settings,
|
settings,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
if (result.status === 'success') {
|
if (result.status === 'success') {
|
||||||
commit('confirmProfileOption', { name, value })
|
commit('confirmProfileOption', { name, value })
|
||||||
|
|
|
||||||
|
|
@ -38,9 +38,9 @@ import {
|
||||||
unretweet,
|
unretweet,
|
||||||
} from '../services/api/api.service.js'
|
} from '../services/api/api.service.js'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
|
||||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
const emptyTl = (userId = 0) => ({
|
const emptyTl = (userId = 0) => ({
|
||||||
statuses: [],
|
statuses: [],
|
||||||
|
|
@ -632,7 +632,7 @@ const statuses = {
|
||||||
fetchStatusSource({ rootState }, status) {
|
fetchStatusSource({ rootState }, status) {
|
||||||
return fetchStatusSource({
|
return fetchStatusSource({
|
||||||
id: status.id,
|
id: status.id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
fetchStatusHistory(_, status) {
|
fetchStatusHistory(_, status) {
|
||||||
|
|
@ -641,7 +641,7 @@ const statuses = {
|
||||||
deleteStatus({ rootState, commit }, status) {
|
deleteStatus({ rootState, commit }, status) {
|
||||||
deleteStatus({
|
deleteStatus({
|
||||||
id: status.id,
|
id: status.id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
commit('setDeleted', { status })
|
commit('setDeleted', { status })
|
||||||
|
|
@ -667,7 +667,7 @@ const statuses = {
|
||||||
commit('setFavorited', { status, value: true })
|
commit('setFavorited', { status, value: true })
|
||||||
favorite({
|
favorite({
|
||||||
id: status.id,
|
id: status.id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((status) =>
|
}).then((status) =>
|
||||||
commit('setFavoritedConfirm', {
|
commit('setFavoritedConfirm', {
|
||||||
status,
|
status,
|
||||||
|
|
@ -680,7 +680,7 @@ const statuses = {
|
||||||
commit('setFavorited', { status, value: false })
|
commit('setFavorited', { status, value: false })
|
||||||
unfavorite({
|
unfavorite({
|
||||||
id: status.id,
|
id: status.id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((status) =>
|
}).then((status) =>
|
||||||
commit('setFavoritedConfirm', {
|
commit('setFavoritedConfirm', {
|
||||||
status,
|
status,
|
||||||
|
|
@ -691,7 +691,7 @@ const statuses = {
|
||||||
fetchPinnedStatuses({ rootState, dispatch }, userId) {
|
fetchPinnedStatuses({ rootState, dispatch }, userId) {
|
||||||
fetchPinnedStatuses({
|
fetchPinnedStatuses({
|
||||||
id: userId,
|
id: userId,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((statuses) =>
|
}).then((statuses) =>
|
||||||
dispatch('addNewStatuses', {
|
dispatch('addNewStatuses', {
|
||||||
statuses,
|
statuses,
|
||||||
|
|
@ -705,25 +705,25 @@ const statuses = {
|
||||||
pinStatus({ rootState, dispatch }, statusId) {
|
pinStatus({ rootState, dispatch }, statusId) {
|
||||||
return pinOwnStatus({
|
return pinOwnStatus({
|
||||||
id: statusId,
|
id: statusId,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((status) => dispatch('addNewStatuses', { statuses: [status] }))
|
}).then((status) => dispatch('addNewStatuses', { statuses: [status] }))
|
||||||
},
|
},
|
||||||
unpinStatus({ rootState, dispatch }, statusId) {
|
unpinStatus({ rootState, dispatch }, statusId) {
|
||||||
return unpinOwnStatus({
|
return unpinOwnStatus({
|
||||||
id: statusId,
|
id: statusId,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((status) => dispatch('addNewStatuses', { statuses: [status] }))
|
}).then((status) => dispatch('addNewStatuses', { statuses: [status] }))
|
||||||
},
|
},
|
||||||
muteConversation({ rootState, commit }, { id: statusId }) {
|
muteConversation({ rootState, commit }, { id: statusId }) {
|
||||||
return muteConversation({
|
return muteConversation({
|
||||||
id: statusId,
|
id: statusId,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((status) => commit('setMutedStatus', status))
|
}).then((status) => commit('setMutedStatus', status))
|
||||||
},
|
},
|
||||||
unmuteConversation({ rootState, commit }, { id: statusId }) {
|
unmuteConversation({ rootState, commit }, { id: statusId }) {
|
||||||
return unmuteConversation({
|
return unmuteConversation({
|
||||||
id: statusId,
|
id: statusId,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((status) => commit('setMutedStatus', status))
|
}).then((status) => commit('setMutedStatus', status))
|
||||||
},
|
},
|
||||||
retweet({ rootState, commit }, status) {
|
retweet({ rootState, commit }, status) {
|
||||||
|
|
@ -731,7 +731,7 @@ const statuses = {
|
||||||
commit('setRetweeted', { status, value: true })
|
commit('setRetweeted', { status, value: true })
|
||||||
retweet({
|
retweet({
|
||||||
id: status.id,
|
id: status.id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((status) =>
|
}).then((status) =>
|
||||||
commit('setRetweetedConfirm', {
|
commit('setRetweetedConfirm', {
|
||||||
status: status.retweeted_status,
|
status: status.retweeted_status,
|
||||||
|
|
@ -744,7 +744,7 @@ const statuses = {
|
||||||
commit('setRetweeted', { status, value: false })
|
commit('setRetweeted', { status, value: false })
|
||||||
unretweet({
|
unretweet({
|
||||||
id: status.id,
|
id: status.id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((status) =>
|
}).then((status) =>
|
||||||
commit('setRetweetedConfirm', {
|
commit('setRetweetedConfirm', {
|
||||||
status,
|
status,
|
||||||
|
|
@ -757,7 +757,7 @@ const statuses = {
|
||||||
bookmarkStatus({
|
bookmarkStatus({
|
||||||
id: status.id,
|
id: status.id,
|
||||||
folder_id: status.bookmark_folder_id,
|
folder_id: status.bookmark_folder_id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((status) => {
|
}).then((status) => {
|
||||||
commit('setBookmarkedConfirm', { status })
|
commit('setBookmarkedConfirm', { status })
|
||||||
})
|
})
|
||||||
|
|
@ -766,7 +766,7 @@ const statuses = {
|
||||||
commit('setBookmarked', { status, value: false })
|
commit('setBookmarked', { status, value: false })
|
||||||
unbookmarkStatus({
|
unbookmarkStatus({
|
||||||
id: status.id,
|
id: status.id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((status) => {
|
}).then((status) => {
|
||||||
commit('setBookmarkedConfirm', { status })
|
commit('setBookmarkedConfirm', { status })
|
||||||
})
|
})
|
||||||
|
|
@ -781,11 +781,11 @@ const statuses = {
|
||||||
Promise.all([
|
Promise.all([
|
||||||
fetchFavoritedByUsers({
|
fetchFavoritedByUsers({
|
||||||
id,
|
id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}),
|
}),
|
||||||
fetchRebloggedByUsers({
|
fetchRebloggedByUsers({
|
||||||
id,
|
id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}),
|
}),
|
||||||
]).then(([favoritedByUsers, rebloggedByUsers]) => {
|
]).then(([favoritedByUsers, rebloggedByUsers]) => {
|
||||||
commit('addFavs', {
|
commit('addFavs', {
|
||||||
|
|
@ -808,7 +808,7 @@ const statuses = {
|
||||||
reactWithEmoji({
|
reactWithEmoji({
|
||||||
id,
|
id,
|
||||||
emoji,
|
emoji,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
dispatch('fetchEmojiReactionsBy', id)
|
dispatch('fetchEmojiReactionsBy', id)
|
||||||
})
|
})
|
||||||
|
|
@ -829,7 +829,7 @@ const statuses = {
|
||||||
fetchEmojiReactionsBy({ rootState, commit }, id) {
|
fetchEmojiReactionsBy({ rootState, commit }, id) {
|
||||||
return fetchEmojiReactions({
|
return fetchEmojiReactions({
|
||||||
id,
|
id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((emojiReactions) => {
|
}).then((emojiReactions) => {
|
||||||
commit('addEmojiReactionsBy', {
|
commit('addEmojiReactionsBy', {
|
||||||
id,
|
id,
|
||||||
|
|
@ -841,7 +841,7 @@ const statuses = {
|
||||||
fetchFavs({ rootState, commit }, id) {
|
fetchFavs({ rootState, commit }, id) {
|
||||||
fetchFavoritedByUsers({
|
fetchFavoritedByUsers({
|
||||||
id,
|
id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((favoritedByUsers) =>
|
}).then((favoritedByUsers) =>
|
||||||
commit('addFavs', {
|
commit('addFavs', {
|
||||||
id,
|
id,
|
||||||
|
|
@ -853,7 +853,7 @@ const statuses = {
|
||||||
fetchRepeats({ rootState, commit }, id) {
|
fetchRepeats({ rootState, commit }, id) {
|
||||||
fetchRebloggedByUsers({
|
fetchRebloggedByUsers({
|
||||||
id,
|
id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((rebloggedByUsers) =>
|
}).then((rebloggedByUsers) =>
|
||||||
commit('addRepeats', {
|
commit('addRepeats', {
|
||||||
id,
|
id,
|
||||||
|
|
@ -870,7 +870,7 @@ const statuses = {
|
||||||
offset,
|
offset,
|
||||||
following,
|
following,
|
||||||
type,
|
type,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((data) => {
|
}).then((data) => {
|
||||||
store.commit('addNewUsers', data.accounts)
|
store.commit('addNewUsers', data.accounts)
|
||||||
store.commit(
|
store.commit(
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ import {
|
||||||
} from '../services/window_utils/window_utils'
|
} from '../services/window_utils/window_utils'
|
||||||
|
|
||||||
import { useBookmarkFoldersStore } from 'src/stores/bookmark_folders.js'
|
import { useBookmarkFoldersStore } from 'src/stores/bookmark_folders.js'
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
|
||||||
import { useEmojiStore } from 'src/stores/emoji.js'
|
import { useEmojiStore } from 'src/stores/emoji.js'
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
|
|
@ -133,7 +132,7 @@ const localMuteUser = (store, args) => {
|
||||||
return muteUser({
|
return muteUser({
|
||||||
id,
|
id,
|
||||||
expiresIn,
|
expiresIn,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((relationship) => {
|
}).then((relationship) => {
|
||||||
store.commit('updateUserRelationship', [relationship])
|
store.commit('updateUserRelationship', [relationship])
|
||||||
store.commit('addMuteId', id)
|
store.commit('addMuteId', id)
|
||||||
|
|
@ -154,7 +153,7 @@ const hideReblogs = (store, userId) => {
|
||||||
return followUser({
|
return followUser({
|
||||||
id: userId,
|
id: userId,
|
||||||
reblogs: false,
|
reblogs: false,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((relationship) => {
|
}).then((relationship) => {
|
||||||
store.commit('updateUserRelationship', [relationship])
|
store.commit('updateUserRelationship', [relationship])
|
||||||
})
|
})
|
||||||
|
|
@ -164,7 +163,7 @@ const showReblogs = (store, userId) => {
|
||||||
return followUser({
|
return followUser({
|
||||||
id: userId,
|
id: userId,
|
||||||
reblogs: true,
|
reblogs: true,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((relationship) =>
|
}).then((relationship) =>
|
||||||
store.commit('updateUserRelationship', [relationship]),
|
store.commit('updateUserRelationship', [relationship]),
|
||||||
)
|
)
|
||||||
|
|
@ -173,14 +172,14 @@ const showReblogs = (store, userId) => {
|
||||||
const muteDomain = (store, domain) => {
|
const muteDomain = (store, domain) => {
|
||||||
return muteDomain({
|
return muteDomain({
|
||||||
domain,
|
domain,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then(() => store.commit('addDomainMute', domain))
|
}).then(() => store.commit('addDomainMute', domain))
|
||||||
}
|
}
|
||||||
|
|
||||||
const unmuteDomain = (store, domain) => {
|
const unmuteDomain = (store, domain) => {
|
||||||
return unmuteDomain({
|
return unmuteDomain({
|
||||||
domain,
|
domain,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then(() => store.commit('removeDomainMute', domain))
|
}).then(() => store.commit('removeDomainMute', domain))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -404,7 +403,7 @@ const users = {
|
||||||
fetchUser(store, id) {
|
fetchUser(store, id) {
|
||||||
return fetchUser({
|
return fetchUser({
|
||||||
id,
|
id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((user) => {
|
}).then((user) => {
|
||||||
store.commit('addNewUsers', [user])
|
store.commit('addNewUsers', [user])
|
||||||
return user
|
return user
|
||||||
|
|
@ -413,7 +412,7 @@ const users = {
|
||||||
fetchUserByName(store, name) {
|
fetchUserByName(store, name) {
|
||||||
return fetchUserByName({
|
return fetchUserByName({
|
||||||
name,
|
name,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((user) => {
|
}).then((user) => {
|
||||||
store.commit('addNewUsers', [user])
|
store.commit('addNewUsers', [user])
|
||||||
return user
|
return user
|
||||||
|
|
@ -423,7 +422,7 @@ const users = {
|
||||||
if (store.state.currentUser) {
|
if (store.state.currentUser) {
|
||||||
fetchUserRelationship({
|
fetchUserRelationship({
|
||||||
id,
|
id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((relationships) =>
|
}).then((relationships) =>
|
||||||
store.commit('updateUserRelationship', relationships),
|
store.commit('updateUserRelationship', relationships),
|
||||||
)
|
)
|
||||||
|
|
@ -433,7 +432,7 @@ const users = {
|
||||||
if (store.state.currentUser) {
|
if (store.state.currentUser) {
|
||||||
fetchUserInLists({
|
fetchUserInLists({
|
||||||
id,
|
id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((inLists) => store.commit('updateUserInLists', { id, inLists }))
|
}).then((inLists) => store.commit('updateUserInLists', { id, inLists }))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -443,7 +442,7 @@ const users = {
|
||||||
const maxId = store.state.currentUser.blockIdsMaxId
|
const maxId = store.state.currentUser.blockIdsMaxId
|
||||||
return fetchBlocks({
|
return fetchBlocks({
|
||||||
maxId,
|
maxId,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((blocks) => {
|
}).then((blocks) => {
|
||||||
if (reset) {
|
if (reset) {
|
||||||
store.commit('saveBlockIds', map(blocks, 'id'))
|
store.commit('saveBlockIds', map(blocks, 'id'))
|
||||||
|
|
@ -481,7 +480,7 @@ const users = {
|
||||||
const maxId = store.state.currentUser.muteIdsMaxId
|
const maxId = store.state.currentUser.muteIdsMaxId
|
||||||
return fetchMutes({
|
return fetchMutes({
|
||||||
maxId,
|
maxId,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((mutes) => {
|
}).then((mutes) => {
|
||||||
if (reset) {
|
if (reset) {
|
||||||
store.commit('saveMuteIds', map(mutes, 'id'))
|
store.commit('saveMuteIds', map(mutes, 'id'))
|
||||||
|
|
@ -515,7 +514,7 @@ const users = {
|
||||||
},
|
},
|
||||||
fetchDomainMutes(store) {
|
fetchDomainMutes(store) {
|
||||||
return fetchDomainMutes({
|
return fetchDomainMutes({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((domainMutes) => {
|
}).then((domainMutes) => {
|
||||||
store.commit('saveDomainMutes', domainMutes)
|
store.commit('saveDomainMutes', domainMutes)
|
||||||
return domainMutes
|
return domainMutes
|
||||||
|
|
@ -539,7 +538,7 @@ const users = {
|
||||||
return fetchFriends({
|
return fetchFriends({
|
||||||
id,
|
id,
|
||||||
maxId,
|
maxId,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((friends) => {
|
}).then((friends) => {
|
||||||
commit('addNewUsers', friends)
|
commit('addNewUsers', friends)
|
||||||
commit('saveFriendIds', { id, friendIds: map(friends, 'id') })
|
commit('saveFriendIds', { id, friendIds: map(friends, 'id') })
|
||||||
|
|
@ -552,7 +551,7 @@ const users = {
|
||||||
return fetchFollowers({
|
return fetchFollowers({
|
||||||
id,
|
id,
|
||||||
maxId,
|
maxId,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((followers) => {
|
}).then((followers) => {
|
||||||
commit('addNewUsers', followers)
|
commit('addNewUsers', followers)
|
||||||
commit('saveFollowerIds', { id, followerIds: map(followers, 'id') })
|
commit('saveFollowerIds', { id, followerIds: map(followers, 'id') })
|
||||||
|
|
@ -569,7 +568,7 @@ const users = {
|
||||||
return followUser({
|
return followUser({
|
||||||
id,
|
id,
|
||||||
notify: true,
|
notify: true,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((relationship) =>
|
}).then((relationship) =>
|
||||||
commit('updateUserRelationship', [relationship]),
|
commit('updateUserRelationship', [relationship]),
|
||||||
)
|
)
|
||||||
|
|
@ -578,7 +577,7 @@ const users = {
|
||||||
return followUser({
|
return followUser({
|
||||||
id,
|
id,
|
||||||
notify: false,
|
notify: false,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((relationship) =>
|
}).then((relationship) =>
|
||||||
commit('updateUserRelationship', [relationship]),
|
commit('updateUserRelationship', [relationship]),
|
||||||
)
|
)
|
||||||
|
|
@ -644,7 +643,7 @@ const users = {
|
||||||
searchUsers({ rootState, commit }, { query }) {
|
searchUsers({ rootState, commit }, { query }) {
|
||||||
return searchUsers({
|
return searchUsers({
|
||||||
query,
|
query,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((users) => {
|
}).then((users) => {
|
||||||
commit('addNewUsers', users)
|
commit('addNewUsers', users)
|
||||||
return users
|
return users
|
||||||
|
|
@ -679,7 +678,7 @@ const users = {
|
||||||
},
|
},
|
||||||
getCaptcha(store) {
|
getCaptcha(store) {
|
||||||
return getCaptcha({
|
return getCaptcha({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -704,7 +703,6 @@ const users = {
|
||||||
store.dispatch('disconnectFromSocket')
|
store.dispatch('disconnectFromSocket')
|
||||||
oauth.clearToken()
|
oauth.clearToken()
|
||||||
store.dispatch('stopFetchingTimeline', 'friends')
|
store.dispatch('stopFetchingTimeline', 'friends')
|
||||||
useCredentialsStore().setCredentials(null)
|
|
||||||
store.dispatch('stopFetchingNotifications')
|
store.dispatch('stopFetchingNotifications')
|
||||||
useListsStore().stopFetching()
|
useListsStore().stopFetching()
|
||||||
useBookmarkFoldersStore().stopFetching()
|
useBookmarkFoldersStore().stopFetching()
|
||||||
|
|
@ -721,9 +719,11 @@ const users = {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const commit = store.commit
|
const commit = store.commit
|
||||||
const dispatch = store.dispatch
|
const dispatch = store.dispatch
|
||||||
|
|
||||||
commit('beginLogin')
|
commit('beginLogin')
|
||||||
|
|
||||||
verifyCredentials({
|
verifyCredentials({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (!data.error) {
|
if (!data.error) {
|
||||||
|
|
@ -753,9 +753,6 @@ const users = {
|
||||||
useInterfaceStore().setNotificationPermission(permission),
|
useInterfaceStore().setNotificationPermission(permission),
|
||||||
)
|
)
|
||||||
|
|
||||||
// Update credentials
|
|
||||||
useCredentialsStore().setCredentials(accessToken)
|
|
||||||
|
|
||||||
// Do server-side storage migrations
|
// Do server-side storage migrations
|
||||||
|
|
||||||
// Debug snippet to clean up storage and reset migrations
|
// Debug snippet to clean up storage and reset migrations
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,8 @@ const REPORTS = '/api/v1/pleroma/admin/reports'
|
||||||
const CONFIG_URL = '/api/v1/pleroma/admin/config'
|
const CONFIG_URL = '/api/v1/pleroma/admin/config'
|
||||||
const DESCRIPTIONS_URL = '/api/v1/pleroma/admin/config/descriptions'
|
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_URL = '/api/v1/pleroma/admin/frontends'
|
||||||
const FRONTENDS_INSTALL_URL = '/api/v1/pleroma/admin/frontends/install'
|
const FRONTENDS_INSTALL_URL = '/api/v1/pleroma/admin/frontends/install'
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
fetchUserRelationship,
|
fetchUserRelationship,
|
||||||
|
|
@ -11,7 +11,7 @@ const fetchRelationship = (attempt, userId, store) =>
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
fetchUserRelationship({
|
fetchUserRelationship({
|
||||||
id: userId,
|
id: userId,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
.then((relationship) => {
|
.then((relationship) => {
|
||||||
store.commit('updateUserRelationship', [relationship])
|
store.commit('updateUserRelationship', [relationship])
|
||||||
|
|
@ -39,7 +39,7 @@ export const requestFollow = (userId, store) =>
|
||||||
new Promise((resolve) => {
|
new Promise((resolve) => {
|
||||||
followUser({
|
followUser({
|
||||||
id: userId,
|
id: userId,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((updated) => {
|
}).then((updated) => {
|
||||||
store.commit('updateUserRelationship', [updated])
|
store.commit('updateUserRelationship', [updated])
|
||||||
|
|
||||||
|
|
@ -66,7 +66,7 @@ export const requestUnfollow = (userId, store) =>
|
||||||
new Promise((resolve) => {
|
new Promise((resolve) => {
|
||||||
unfollowUser({
|
unfollowUser({
|
||||||
id: userId,
|
id: userId,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((updated) => {
|
}).then((updated) => {
|
||||||
store.commit('updateUserRelationship', [updated])
|
store.commit('updateUserRelationship', [updated])
|
||||||
resolve({
|
resolve({
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,10 @@
|
||||||
|
|
||||||
const wait = (timeout) => {
|
const wait = (timeout) => {
|
||||||
let timeoutId
|
let timeoutId
|
||||||
const promise = () => new Promise((resolve) => {
|
const promise = () =>
|
||||||
timeoutId = window.setTimeout(() => resolve(), timeout)
|
new Promise((resolve) => {
|
||||||
})
|
timeoutId = window.setTimeout(() => resolve(), timeout)
|
||||||
|
})
|
||||||
return { timeoutId, promise }
|
return { timeoutId, promise }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { cloneDeep, differenceWith, flatten, get, isEqual, set } from 'lodash'
|
import { cloneDeep, differenceWith, flatten, get, isEqual, set } from 'lodash'
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
addNewEmojiFile,
|
addNewEmojiFile,
|
||||||
|
|
@ -86,7 +86,7 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
|
|
||||||
loadAdminStuff() {
|
loadAdminStuff() {
|
||||||
getInstanceDBConfig({
|
getInstanceDBConfig({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((backendDbConfig) => {
|
}).then((backendDbConfig) => {
|
||||||
if (backendDbConfig.error) {
|
if (backendDbConfig.error) {
|
||||||
if (backendDbConfig.error.status === 400) {
|
if (backendDbConfig.error.status === 400) {
|
||||||
|
|
@ -98,17 +98,17 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.setInstanceAdminSettings({
|
this.setInstanceAdminSettings({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
backendDbConfig,
|
backendDbConfig,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (this.descriptions === null) {
|
if (this.descriptions === null) {
|
||||||
getInstanceConfigDescriptions({
|
getInstanceConfigDescriptions({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((backendDescriptions) =>
|
}).then((backendDescriptions) =>
|
||||||
this.setInstanceAdminDescriptions({
|
this.setInstanceAdminDescriptions({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
backendDescriptions,
|
backendDescriptions,
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
@ -243,19 +243,19 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
})
|
})
|
||||||
|
|
||||||
pushInstanceDBConfig({
|
pushInstanceDBConfig({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
payload: {
|
payload: {
|
||||||
configs: changed,
|
configs: changed,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(() =>
|
.then(() =>
|
||||||
getInstanceDBConfig({
|
getInstanceDBConfig({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.then((backendDbConfig) =>
|
.then((backendDbConfig) =>
|
||||||
this.setInstanceAdminSettings({
|
this.setInstanceAdminSettings({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
|
|
||||||
backendDbConfig,
|
backendDbConfig,
|
||||||
}),
|
}),
|
||||||
|
|
@ -280,7 +280,7 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
}
|
}
|
||||||
|
|
||||||
pushInstanceDBConfig({
|
pushInstanceDBConfig({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
payload: {
|
payload: {
|
||||||
configs: [
|
configs: [
|
||||||
{
|
{
|
||||||
|
|
@ -293,12 +293,12 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
})
|
})
|
||||||
.then(() =>
|
.then(() =>
|
||||||
getInstanceDBConfig({
|
getInstanceDBConfig({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.then((backendDbConfig) =>
|
.then((backendDbConfig) =>
|
||||||
this.setInstanceAdminSettings({
|
this.setInstanceAdminSettings({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
backendDbConfig,
|
backendDbConfig,
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
@ -311,7 +311,7 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
this.modifiedPaths.delete(path)
|
this.modifiedPaths.delete(path)
|
||||||
|
|
||||||
return pushInstanceDBConfig({
|
return pushInstanceDBConfig({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
payload: {
|
payload: {
|
||||||
configs: [
|
configs: [
|
||||||
{
|
{
|
||||||
|
|
@ -325,7 +325,7 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
})
|
})
|
||||||
.then(() =>
|
.then(() =>
|
||||||
getInstanceDBConfig({
|
getInstanceDBConfig({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.then((backendDbConfig) =>
|
.then((backendDbConfig) =>
|
||||||
|
|
@ -336,7 +336,7 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
// Frontends Stuff
|
// Frontends Stuff
|
||||||
loadFrontendsStuff() {
|
loadFrontendsStuff() {
|
||||||
getAvailableFrontends({
|
getAvailableFrontends({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((frontends) => this.setAvailableFrontends({ frontends }))
|
}).then((frontends) => this.setAvailableFrontends({ frontends }))
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -354,14 +354,14 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
|
|
||||||
installFrontend() {
|
installFrontend() {
|
||||||
return installFrontend({
|
return installFrontend({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// Statuses stuff
|
// Statuses stuff
|
||||||
async fetchStatuses(opts) {
|
async fetchStatuses(opts) {
|
||||||
const { total, activities } = await listStatuses({
|
const { total, activities } = await listStatuses({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
opts,
|
opts,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -376,7 +376,7 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
},
|
},
|
||||||
async changeStatusScope(opts) {
|
async changeStatusScope(opts) {
|
||||||
const raw = await changeStatusScope({
|
const raw = await changeStatusScope({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
opts,
|
opts,
|
||||||
})
|
})
|
||||||
const status = parseStatus(raw)
|
const status = parseStatus(raw)
|
||||||
|
|
@ -387,7 +387,7 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
// Users stuff
|
// Users stuff
|
||||||
async fetchUsers(opts) {
|
async fetchUsers(opts) {
|
||||||
const { users, count } = await listUsers({
|
const { users, count } = await listUsers({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
|
|
||||||
opts,
|
opts,
|
||||||
})
|
})
|
||||||
|
|
@ -409,7 +409,7 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
const { screen_name } = user
|
const { screen_name } = user
|
||||||
|
|
||||||
const result = await api({
|
const result = await api({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
screen_name,
|
screen_name,
|
||||||
})
|
})
|
||||||
window.vuex.commit('updateUserAdminData', { user: result })
|
window.vuex.commit('updateUserAdminData', { user: result })
|
||||||
|
|
@ -419,7 +419,7 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
const api = deleteAccounts
|
const api = deleteAccounts
|
||||||
|
|
||||||
const resultUserIds = await api({
|
const resultUserIds = await api({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
screen_names,
|
screen_names,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -437,7 +437,7 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
const screen_names = users.map((u) => u.screen_name)
|
const screen_names = users.map((u) => u.screen_name)
|
||||||
|
|
||||||
return resendConfirmationEmail({
|
return resendConfirmationEmail({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
screen_names,
|
screen_names,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
@ -445,7 +445,7 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
const screen_names = users.map((u) => u.screen_name)
|
const screen_names = users.map((u) => u.screen_name)
|
||||||
|
|
||||||
return requirePasswordChange({
|
return requirePasswordChange({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
screen_names,
|
screen_names,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
@ -454,7 +454,7 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
const { screen_name } = user
|
const { screen_name } = user
|
||||||
|
|
||||||
return disableMFA({
|
return disableMFA({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
screen_name,
|
screen_name,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
@ -463,7 +463,7 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
const api = setUsersTags
|
const api = setUsersTags
|
||||||
|
|
||||||
await api({
|
await api({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
screen_names,
|
screen_names,
|
||||||
tags,
|
tags,
|
||||||
value,
|
value,
|
||||||
|
|
@ -478,7 +478,7 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
const api = setUsersRight
|
const api = setUsersRight
|
||||||
|
|
||||||
await api({
|
await api({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
screen_names,
|
screen_names,
|
||||||
right,
|
right,
|
||||||
value,
|
value,
|
||||||
|
|
@ -493,7 +493,7 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
const api = setUsersActivationStatus
|
const api = setUsersActivationStatus
|
||||||
|
|
||||||
const resultUsers = await api({
|
const resultUsers = await api({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
screen_names,
|
screen_names,
|
||||||
value,
|
value,
|
||||||
})
|
})
|
||||||
|
|
@ -507,7 +507,7 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
const api = setUsersSuggestionStatus
|
const api = setUsersSuggestionStatus
|
||||||
|
|
||||||
const resultUsers = await api({
|
const resultUsers = await api({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
screen_names,
|
screen_names,
|
||||||
value,
|
value,
|
||||||
})
|
})
|
||||||
|
|
@ -521,7 +521,7 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
const api = setUsersConfirmationStatus
|
const api = setUsersConfirmationStatus
|
||||||
|
|
||||||
await api({
|
await api({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
screen_names,
|
screen_names,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -534,7 +534,7 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
const api = setUsersApprovalStatus
|
const api = setUsersApprovalStatus
|
||||||
|
|
||||||
const resultUsers = await api({
|
const resultUsers = await api({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
screen_names,
|
screen_names,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -543,21 +543,21 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
reloadEmoji() {
|
reloadEmoji() {
|
||||||
return reloadEmoji({ credentials: useCredentialsStore().current })
|
return reloadEmoji({ credentials: useOAuthStore().token })
|
||||||
},
|
},
|
||||||
importEmojiFromFS() {
|
importEmojiFromFS() {
|
||||||
return importEmojiFromFS({ credentials: useCredentialsStore().current })
|
return importEmojiFromFS({ credentials: useOAuthStore().token })
|
||||||
},
|
},
|
||||||
listEmojiPacks(params) {
|
listEmojiPacks(params) {
|
||||||
return listEmojiPacks({
|
return listEmojiPacks({
|
||||||
...params,
|
...params,
|
||||||
credentials: useCredentialsStore().current
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
listRemoteEmojiPacks(params) {
|
listRemoteEmojiPacks(params) {
|
||||||
return listRemoteEmojiPacks({
|
return listRemoteEmojiPacks({
|
||||||
...params,
|
...params,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
addNewEmojiFile({ packName, file, shortcode, filename }) {
|
addNewEmojiFile({ packName, file, shortcode, filename }) {
|
||||||
|
|
@ -566,7 +566,7 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
file,
|
file,
|
||||||
shortcode,
|
shortcode,
|
||||||
filename,
|
filename,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
downloadRemoteEmojiPack({ instance, packName, as }) {
|
downloadRemoteEmojiPack({ instance, packName, as }) {
|
||||||
|
|
@ -574,33 +574,33 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
instance,
|
instance,
|
||||||
packName,
|
packName,
|
||||||
as,
|
as,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
downloadRemoteEmojiPackZIP({ url, packName }) {
|
downloadRemoteEmojiPackZIP({ url, packName }) {
|
||||||
return downloadRemoteEmojiPackZIP({
|
return downloadRemoteEmojiPackZIP({
|
||||||
url,
|
url,
|
||||||
packName,
|
packName,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
createEmojiPack({ name }) {
|
createEmojiPack({ name }) {
|
||||||
return createEmojiPack({
|
return createEmojiPack({
|
||||||
name,
|
name,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
deleteEmojiPack({ name }) {
|
deleteEmojiPack({ name }) {
|
||||||
return createEmojiPack({
|
return createEmojiPack({
|
||||||
name,
|
name,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
saveEmojiPackMetadata({ name, newData }) {
|
saveEmojiPackMetadata({ name, newData }) {
|
||||||
return createEmojiPack({
|
return createEmojiPack({
|
||||||
name,
|
name,
|
||||||
newData,
|
newData,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getAnnouncements as adminGetAnnouncements,
|
getAnnouncements as adminGetAnnouncements,
|
||||||
|
|
@ -47,15 +47,15 @@ export const useAnnouncementsStore = defineStore('announcements', {
|
||||||
const fetchAnnouncements = async () => {
|
const fetchAnnouncements = async () => {
|
||||||
if (!isAdmin) {
|
if (!isAdmin) {
|
||||||
return getAnnouncements({
|
return getAnnouncements({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const all = await adminGetAnnouncements({
|
const all = await adminGetAnnouncements({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
const visible = await getAnnouncements({
|
const visible = await getAnnouncements({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
const visibleObject = visible.reduce((a, c) => {
|
const visibleObject = visible.reduce((a, c) => {
|
||||||
a[c.id] = c
|
a[c.id] = c
|
||||||
|
|
@ -93,7 +93,7 @@ export const useAnnouncementsStore = defineStore('announcements', {
|
||||||
markAnnouncementAsRead(id) {
|
markAnnouncementAsRead(id) {
|
||||||
return dismissAnnouncement({
|
return dismissAnnouncement({
|
||||||
id,
|
id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
const index = this.announcements.findIndex((a) => a.id === id)
|
const index = this.announcements.findIndex((a) => a.id === id)
|
||||||
|
|
||||||
|
|
@ -124,7 +124,7 @@ export const useAnnouncementsStore = defineStore('announcements', {
|
||||||
},
|
},
|
||||||
postAnnouncement({ content, startsAt, endsAt, allDay }) {
|
postAnnouncement({ content, startsAt, endsAt, allDay }) {
|
||||||
return postAnnouncement({
|
return postAnnouncement({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
content,
|
content,
|
||||||
startsAt,
|
startsAt,
|
||||||
endsAt,
|
endsAt,
|
||||||
|
|
@ -140,7 +140,7 @@ export const useAnnouncementsStore = defineStore('announcements', {
|
||||||
startsAt,
|
startsAt,
|
||||||
endsAt,
|
endsAt,
|
||||||
allDay,
|
allDay,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
return this.fetchAnnouncements()
|
return this.fetchAnnouncements()
|
||||||
})
|
})
|
||||||
|
|
@ -148,7 +148,7 @@ export const useAnnouncementsStore = defineStore('announcements', {
|
||||||
deleteAnnouncement(id) {
|
deleteAnnouncement(id) {
|
||||||
return deleteAnnouncement({
|
return deleteAnnouncement({
|
||||||
id,
|
id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
return this.fetchAnnouncements()
|
return this.fetchAnnouncements()
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { find, remove } from 'lodash'
|
import { find, remove } from 'lodash'
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
createBookmarkFolder,
|
createBookmarkFolder,
|
||||||
|
|
@ -29,7 +29,7 @@ export const useBookmarkFoldersStore = defineStore('bookmarkFolders', {
|
||||||
startFetching() {
|
startFetching() {
|
||||||
promiseInterval(() => {
|
promiseInterval(() => {
|
||||||
this.fetcher = fetchBookmarkFolders({
|
this.fetcher = fetchBookmarkFolders({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
.then(
|
.then(
|
||||||
(folders) => this.setBookmarkFolders(folders),
|
(folders) => this.setBookmarkFolders(folders),
|
||||||
|
|
@ -60,7 +60,7 @@ export const useBookmarkFoldersStore = defineStore('bookmarkFolders', {
|
||||||
return createBookmarkFolder({
|
return createBookmarkFolder({
|
||||||
name,
|
name,
|
||||||
emoji,
|
emoji,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((folder) => {
|
}).then((folder) => {
|
||||||
this.setBookmarkFolder(folder)
|
this.setBookmarkFolder(folder)
|
||||||
return folder
|
return folder
|
||||||
|
|
@ -68,7 +68,7 @@ export const useBookmarkFoldersStore = defineStore('bookmarkFolders', {
|
||||||
},
|
},
|
||||||
updateBookmarkFolder({ folderId, name, emoji }) {
|
updateBookmarkFolder({ folderId, name, emoji }) {
|
||||||
return updateBookmarkFolder({
|
return updateBookmarkFolder({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
folderId,
|
folderId,
|
||||||
name,
|
name,
|
||||||
emoji,
|
emoji,
|
||||||
|
|
@ -80,7 +80,7 @@ export const useBookmarkFoldersStore = defineStore('bookmarkFolders', {
|
||||||
deleteBookmarkFolder({ folderId }) {
|
deleteBookmarkFolder({ folderId }) {
|
||||||
deleteBookmarkFolder({
|
deleteBookmarkFolder({
|
||||||
folderId,
|
folderId,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
remove(this.allFolders, (folder) => folder.id === folderId)
|
remove(this.allFolders, (folder) => folder.id === folderId)
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
import { defineStore } from 'pinia'
|
|
||||||
|
|
||||||
const defaultState = {
|
|
||||||
credentials: null,
|
|
||||||
}
|
|
||||||
|
|
||||||
export const useCredentialsStore = defineStore('credentials', {
|
|
||||||
state: () => ({ ...defaultState }),
|
|
||||||
actions: {
|
|
||||||
setCredentials(credentials) {
|
|
||||||
this.credentials = credentials
|
|
||||||
},
|
|
||||||
},
|
|
||||||
getters: {
|
|
||||||
current() {
|
|
||||||
return this.credentials
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import { merge } from 'lodash'
|
import { merge } from 'lodash'
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import { ensureFinalFallback } from 'src/i18n/languages.js'
|
import { ensureFinalFallback } from 'src/i18n/languages.js'
|
||||||
import { listEmojiPacks } from 'src/services/api/api.service.js'
|
import { listEmojiPacks } from 'src/services/api/api.service.js'
|
||||||
|
|
@ -188,9 +188,10 @@ export const useEmojiStore = defineStore('emoji', {
|
||||||
this.adminPacksLocalLoading = true
|
this.adminPacksLocalLoading = true
|
||||||
this.adminPacksLocal = await this.getAdminPacks(
|
this.adminPacksLocal = await this.getAdminPacks(
|
||||||
useInstanceStore().server,
|
useInstanceStore().server,
|
||||||
(params) => listEmojiPacks({
|
(params) =>
|
||||||
|
listEmojiPacks({
|
||||||
...params,
|
...params,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
this.adminPacksLocalLoading = false
|
this.adminPacksLocalLoading = false
|
||||||
|
|
@ -221,14 +222,13 @@ export const useEmojiStore = defineStore('emoji', {
|
||||||
instance,
|
instance,
|
||||||
page: i,
|
page: i,
|
||||||
pageSize,
|
pageSize,
|
||||||
})
|
}).then((pageData) => {
|
||||||
.then((pageData) => {
|
if (pageData.error !== undefined) {
|
||||||
if (pageData.error !== undefined) {
|
return Promise.reject(pageData.error)
|
||||||
return Promise.reject(pageData.error)
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return pageData.packs
|
return pageData.packs
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { find, remove } from 'lodash'
|
import { find, remove } from 'lodash'
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
addAccountsToList,
|
addAccountsToList,
|
||||||
|
|
@ -36,7 +36,7 @@ export const useListsStore = defineStore('lists', {
|
||||||
startFetching() {
|
startFetching() {
|
||||||
promiseInterval(() => {
|
promiseInterval(() => {
|
||||||
this.fetcher = fetchLists({
|
this.fetcher = fetchLists({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
.then(
|
.then(
|
||||||
(lists) => this.setLists(lists),
|
(lists) => this.setLists(lists),
|
||||||
|
|
@ -56,7 +56,7 @@ export const useListsStore = defineStore('lists', {
|
||||||
createList({ title }) {
|
createList({ title }) {
|
||||||
return createList({
|
return createList({
|
||||||
title,
|
title,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((list) => {
|
}).then((list) => {
|
||||||
this.setList({ listId: list.id, title })
|
this.setList({ listId: list.id, title })
|
||||||
return list
|
return list
|
||||||
|
|
@ -65,13 +65,13 @@ export const useListsStore = defineStore('lists', {
|
||||||
fetchList({ listId }) {
|
fetchList({ listId }) {
|
||||||
return getList({
|
return getList({
|
||||||
listId,
|
listId,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((list) => this.setList({ listId: list.id, title: list.title }))
|
}).then((list) => this.setList({ listId: list.id, title: list.title }))
|
||||||
},
|
},
|
||||||
fetchListAccounts({ listId }) {
|
fetchListAccounts({ listId }) {
|
||||||
return getListAccounts({
|
return getListAccounts({
|
||||||
listId,
|
listId,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((accountIds) => {
|
}).then((accountIds) => {
|
||||||
if (!this.allListsObject[listId]) {
|
if (!this.allListsObject[listId]) {
|
||||||
this.allListsObject[listId] = { accountIds: [] }
|
this.allListsObject[listId] = { accountIds: [] }
|
||||||
|
|
@ -83,7 +83,7 @@ export const useListsStore = defineStore('lists', {
|
||||||
updateList({
|
updateList({
|
||||||
listId,
|
listId,
|
||||||
title,
|
title,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
|
|
||||||
if (!this.allListsObject[listId]) {
|
if (!this.allListsObject[listId]) {
|
||||||
|
|
@ -110,14 +110,14 @@ export const useListsStore = defineStore('lists', {
|
||||||
addAccountsToList({
|
addAccountsToList({
|
||||||
listId,
|
listId,
|
||||||
accountIds: added,
|
accountIds: added,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (removed.length > 0) {
|
if (removed.length > 0) {
|
||||||
removeAccountsFromList({
|
removeAccountsFromList({
|
||||||
listId,
|
listId,
|
||||||
accountIds: removed,
|
accountIds: removed,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -125,7 +125,7 @@ export const useListsStore = defineStore('lists', {
|
||||||
return addAccountsToList({
|
return addAccountsToList({
|
||||||
listId,
|
listId,
|
||||||
accountIds: [accountId],
|
accountIds: [accountId],
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
if (!this.allListsObject[listId]) {
|
if (!this.allListsObject[listId]) {
|
||||||
this.allListsObject[listId] = { accountIds: [] }
|
this.allListsObject[listId] = { accountIds: [] }
|
||||||
|
|
@ -138,7 +138,7 @@ export const useListsStore = defineStore('lists', {
|
||||||
return removeAccountsFromList({
|
return removeAccountsFromList({
|
||||||
listId,
|
listId,
|
||||||
accountIds: [accountId],
|
accountIds: [accountId],
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
if (!this.allListsObject[listId]) {
|
if (!this.allListsObject[listId]) {
|
||||||
this.allListsObject[listId] = { accountIds: [] }
|
this.allListsObject[listId] = { accountIds: [] }
|
||||||
|
|
@ -154,7 +154,7 @@ export const useListsStore = defineStore('lists', {
|
||||||
deleteList({ listId }) {
|
deleteList({ listId }) {
|
||||||
deleteList({
|
deleteList({
|
||||||
listId,
|
listId,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
|
|
||||||
delete this.allListsObject[listId]
|
delete this.allListsObject[listId]
|
||||||
|
|
|
||||||
|
|
@ -41,12 +41,9 @@ export const useOAuthStore = defineStore('oauth', {
|
||||||
userToken: false,
|
userToken: false,
|
||||||
}),
|
}),
|
||||||
getters: {
|
getters: {
|
||||||
getToken() {
|
token() {
|
||||||
return this.userToken || this.appToken
|
return this.userToken || this.appToken
|
||||||
},
|
},
|
||||||
getUserToken() {
|
|
||||||
return this.userToken
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
setClientData({ clientId, clientSecret }) {
|
setClientData({ clientId, clientSecret }) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
fetchOAuthTokens,
|
fetchOAuthTokens,
|
||||||
|
|
@ -14,7 +14,7 @@ export const useOAuthTokensStore = defineStore('oauthTokens', {
|
||||||
actions: {
|
actions: {
|
||||||
fetchTokens() {
|
fetchTokens() {
|
||||||
fetchOAuthTokens({
|
fetchOAuthTokens({
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((tokens) => {
|
}).then((tokens) => {
|
||||||
this.swapTokens(tokens)
|
this.swapTokens(tokens)
|
||||||
})
|
})
|
||||||
|
|
@ -22,7 +22,7 @@ export const useOAuthTokensStore = defineStore('oauthTokens', {
|
||||||
revokeToken(id) {
|
revokeToken(id) {
|
||||||
revokeOAuthToken({
|
revokeOAuthToken({
|
||||||
id,
|
id,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if (response.status === 201) {
|
if (response.status === 201) {
|
||||||
this.swapTokens(this.tokens.filter((token) => token.id !== id))
|
this.swapTokens(this.tokens.filter((token) => token.id !== id))
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { merge } from 'lodash'
|
import { merge } from 'lodash'
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import { fetchPoll, vote } from 'src/services/api/api.service.js'
|
import { fetchPoll, vote } from 'src/services/api/api.service.js'
|
||||||
|
|
||||||
|
|
@ -25,7 +25,7 @@ export const usePollsStore = defineStore('polls', {
|
||||||
updateTrackedPoll(pollId) {
|
updateTrackedPoll(pollId) {
|
||||||
fetchPoll({
|
fetchPoll({
|
||||||
pollId,
|
pollId,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((poll) => {
|
}).then((poll) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (this.trackedPolls[pollId]) {
|
if (this.trackedPolls[pollId]) {
|
||||||
|
|
@ -58,7 +58,7 @@ export const usePollsStore = defineStore('polls', {
|
||||||
return vote({
|
return vote({
|
||||||
pollId,
|
pollId,
|
||||||
choices,
|
choices,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((poll) => {
|
}).then((poll) => {
|
||||||
this.mergeOrAddPoll(poll)
|
this.mergeOrAddPoll(poll)
|
||||||
return poll
|
return poll
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import { filter } from 'lodash'
|
import { filter } from 'lodash'
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import { setReportState } from 'src/services/api/admin.js'
|
import { setReportState } from 'src/services/api/admin.js'
|
||||||
|
|
||||||
|
|
@ -45,7 +45,7 @@ export const useReportsStore = defineStore('reports', {
|
||||||
setReportState({
|
setReportState({
|
||||||
id,
|
id,
|
||||||
state,
|
state,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.error('Failed to set report state', e)
|
console.error('Failed to set report state', e)
|
||||||
useInterfaceStore().pushGlobalNotice({
|
useInterfaceStore().pushGlobalNotice({
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,9 @@ import { toRaw } from 'vue'
|
||||||
|
|
||||||
import { CURRENT_UPDATE_COUNTER } from 'src/components/update_notification/update_notification.js'
|
import { CURRENT_UPDATE_COUNTER } from 'src/components/update_notification/update_notification.js'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useLocalConfigStore } from 'src/stores/local_config.js'
|
import { useLocalConfigStore } from 'src/stores/local_config.js'
|
||||||
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import { storage } from 'src/lib/storage.js'
|
import { storage } from 'src/lib/storage.js'
|
||||||
import {
|
import {
|
||||||
|
|
@ -793,7 +793,7 @@ export const useSyncConfigStore = defineStore('sync_config', {
|
||||||
const params = { pleroma_settings_store: { 'pleroma-fe': this.cache } }
|
const params = { pleroma_settings_store: { 'pleroma-fe': this.cache } }
|
||||||
updateProfileJSON({
|
updateProfileJSON({
|
||||||
params,
|
params,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ import {
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { toRaw } from 'vue'
|
import { toRaw } from 'vue'
|
||||||
|
|
||||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import { storage } from 'src/lib/storage.js'
|
import { storage } from 'src/lib/storage.js'
|
||||||
import { updateProfileJSON } from 'src/services/api/api.service.js'
|
import { updateProfileJSON } from 'src/services/api/api.service.js'
|
||||||
|
|
@ -349,7 +349,7 @@ export const useUserHighlightStore = defineStore('user_highlight', {
|
||||||
}
|
}
|
||||||
updateProfileJSON({
|
updateProfileJSON({
|
||||||
params,
|
params,
|
||||||
credentials: useCredentialsStore().current,
|
credentials: useOAuthStore().token,
|
||||||
}).then((user) => {
|
}).then((user) => {
|
||||||
this.initUserHighlight(user)
|
this.initUserHighlight(user)
|
||||||
this.dirty = false
|
this.dirty = false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue