pass 4 - non-obvious changes
This commit is contained in:
parent
617613dfb4
commit
095abb2914
14 changed files with 83 additions and 87 deletions
49
src/App.js
49
src/App.js
|
|
@ -1,4 +1,5 @@
|
||||||
import { throttle } from 'lodash'
|
import { throttle } from 'lodash'
|
||||||
|
import { mapState } from 'pinia'
|
||||||
import { defineAsyncComponent } from 'vue'
|
import { defineAsyncComponent } from 'vue'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
|
|
@ -92,12 +93,9 @@ export default {
|
||||||
this.scrollParent.removeEventListener('scroll', this.updateScrollState)
|
this.scrollParent.removeEventListener('scroll', this.updateScrollState)
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
themeApplied() {
|
|
||||||
return useInterfaceStore().themeApplied
|
|
||||||
},
|
|
||||||
currentTheme() {
|
currentTheme() {
|
||||||
if (useInterfaceStore().styleDataUsed) {
|
if (this.styleDataUsed) {
|
||||||
const styleMeta = useInterfaceStore().styleDataUsed.find(
|
const styleMeta = this.styleDataUsed.find(
|
||||||
(x) => x.component === '@meta',
|
(x) => x.component === '@meta',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -135,9 +133,7 @@ export default {
|
||||||
return this.currentUser.background_image
|
return this.currentUser.background_image
|
||||||
},
|
},
|
||||||
instanceBackground() {
|
instanceBackground() {
|
||||||
return this.mergedConfig.hideInstanceWallpaper
|
return this.mergedConfig.hideInstanceWallpaper ? null : this.background
|
||||||
? null
|
|
||||||
: useInstanceStore().background
|
|
||||||
},
|
},
|
||||||
background() {
|
background() {
|
||||||
return this.userBackground || this.instanceBackground
|
return this.userBackground || this.instanceBackground
|
||||||
|
|
@ -152,14 +148,11 @@ export default {
|
||||||
shout() {
|
shout() {
|
||||||
return useShoutStore().joined
|
return useShoutStore().joined
|
||||||
},
|
},
|
||||||
suggestionsEnabled() {
|
|
||||||
return useInstanceStore().suggestionsEnabled
|
|
||||||
},
|
|
||||||
showInstanceSpecificPanel() {
|
showInstanceSpecificPanel() {
|
||||||
return (
|
return (
|
||||||
useInstanceStore().showInstanceSpecificPanel &&
|
this.showInstanceSpecificPanel &&
|
||||||
!this.$store.getters.mergedConfig.hideISP &&
|
!this.$store.getters.mergedConfig.hideISP &&
|
||||||
useInstanceStore().instanceSpecificPanelContent
|
this.instanceSpecificPanelContent
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
isChats() {
|
isChats() {
|
||||||
|
|
@ -176,24 +169,12 @@ export default {
|
||||||
this.layoutType === 'mobile'
|
this.layoutType === 'mobile'
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
showFeaturesPanel() {
|
|
||||||
return useInstanceStore().showFeaturesPanel
|
|
||||||
},
|
|
||||||
editingAvailable() {
|
|
||||||
return useInstanceStore().editingAvailable
|
|
||||||
},
|
|
||||||
shoutboxPosition() {
|
shoutboxPosition() {
|
||||||
return this.$store.getters.mergedConfig.alwaysShowNewPostButton || false
|
return this.$store.getters.mergedConfig.alwaysShowNewPostButton || false
|
||||||
},
|
},
|
||||||
hideShoutbox() {
|
hideShoutbox() {
|
||||||
return this.$store.getters.mergedConfig.hideShoutbox
|
return this.$store.getters.mergedConfig.hideShoutbox
|
||||||
},
|
},
|
||||||
layoutType() {
|
|
||||||
return useInterfaceStore().layoutType
|
|
||||||
},
|
|
||||||
privateMode() {
|
|
||||||
return useInstanceStore().private
|
|
||||||
},
|
|
||||||
reverseLayout() {
|
reverseLayout() {
|
||||||
const { thirdColumnMode, sidebarRight: reverseSetting } =
|
const { thirdColumnMode, sidebarRight: reverseSetting } =
|
||||||
this.$store.getters.mergedConfig
|
this.$store.getters.mergedConfig
|
||||||
|
|
@ -215,6 +196,24 @@ export default {
|
||||||
return window /* this.$refs.appContentRef */
|
return window /* this.$refs.appContentRef */
|
||||||
},
|
},
|
||||||
...mapGetters(['mergedConfig']),
|
...mapGetters(['mergedConfig']),
|
||||||
|
...mapState(useInterfaceStore, [
|
||||||
|
'themeApplied',
|
||||||
|
'styleDataUsed',
|
||||||
|
'layoutType',
|
||||||
|
]),
|
||||||
|
...mapState(useInstanceStore, [
|
||||||
|
'styleDataUsed',
|
||||||
|
'instanceSpecificPanelContent',
|
||||||
|
'private',
|
||||||
|
]),
|
||||||
|
...mapState(useInstanceStore, {
|
||||||
|
background: (store) => store.instanceIdentity.background,
|
||||||
|
showFeaturesPanel: (store) => store.instanceIdentity.showFeaturesPanel,
|
||||||
|
showInstanceSpecificPanel: (store) =>
|
||||||
|
store.instanceIdentity.showInstanceSpecificPanel,
|
||||||
|
suggestionsEnabled: (store) => store.featureSet.suggestionsEnabled,
|
||||||
|
editingAvailable: (store) => store.featureSet.editingAvailable,
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
resizeHandler() {
|
resizeHandler() {
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,8 @@ import {
|
||||||
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 { useI18nStore } from 'src/stores/i18n'
|
import { useI18nStore } from 'src/stores/i18n'
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
import { useOAuthStore } from 'src/stores/oauth'
|
import { useOAuthStore } from 'src/stores/oauth'
|
||||||
import App from '../App.vue'
|
import App from '../App.vue'
|
||||||
import backendInteractorService from '../services/backend_interactor_service/backend_interactor_service.js'
|
import backendInteractorService from '../services/backend_interactor_service/backend_interactor_service.js'
|
||||||
|
|
@ -168,8 +168,12 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.keys(staticOrApiConfigDefault).map(k => `instanceIdentity.${k}`).forEach(copyInstanceOption)
|
Object.keys(staticOrApiConfigDefault)
|
||||||
Object.keys(instanceDefaultConfig).map(k => `prefsStorage.${k}`).forEach(copyInstanceOption)
|
.map((k) => `instanceIdentity.${k}`)
|
||||||
|
.forEach(copyInstanceOption)
|
||||||
|
Object.keys(instanceDefaultConfig)
|
||||||
|
.map((k) => `prefsStorage.${k}`)
|
||||||
|
.forEach(copyInstanceOption)
|
||||||
|
|
||||||
useAuthFlowStore().setInitialStrategy(config.loginMethod)
|
useAuthFlowStore().setInitialStrategy(config.loginMethod)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import SearchBar from 'components/search_bar/search_bar.vue'
|
import SearchBar from 'components/search_bar/search_bar.vue'
|
||||||
|
import { mapState } from 'pinia'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useInterfaceStore } from 'src/stores/interface'
|
import { useInterfaceStore } from 'src/stores/interface'
|
||||||
|
|
@ -52,7 +53,7 @@ export default {
|
||||||
}),
|
}),
|
||||||
computed: {
|
computed: {
|
||||||
enableMask() {
|
enableMask() {
|
||||||
return this.supportsMask && useInstanceStore().logoMask
|
return this.supportsMask && this.logoMask
|
||||||
},
|
},
|
||||||
logoStyle() {
|
logoStyle() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -62,7 +63,7 @@ export default {
|
||||||
logoMaskStyle() {
|
logoMaskStyle() {
|
||||||
return this.enableMask
|
return this.enableMask
|
||||||
? {
|
? {
|
||||||
'mask-image': `url(${useInstanceStore().logo})`,
|
'mask-image': `url(${this.logo})`,
|
||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
'background-color': this.enableMask ? '' : 'transparent',
|
'background-color': this.enableMask ? '' : 'transparent',
|
||||||
|
|
@ -71,7 +72,7 @@ export default {
|
||||||
logoBgStyle() {
|
logoBgStyle() {
|
||||||
return Object.assign(
|
return Object.assign(
|
||||||
{
|
{
|
||||||
margin: `${useInstanceStore().logoMargin} 0`,
|
margin: `${this.logoMargin} 0`,
|
||||||
opacity: this.searchBarHidden ? 1 : 0,
|
opacity: this.searchBarHidden ? 1 : 0,
|
||||||
},
|
},
|
||||||
this.enableMask
|
this.enableMask
|
||||||
|
|
@ -81,24 +82,18 @@ export default {
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
logo() {
|
...mapState(useInstanceStore, ['private']),
|
||||||
return useInstanceStore().logo
|
...mapState(useInstanceStore, {
|
||||||
},
|
logoMask: (store) => store.instanceIdentity.logoMask,
|
||||||
sitename() {
|
logo: (store) => store.instanceIdentity.logo,
|
||||||
return useInstanceStore().name
|
logoLeft: (store) => store.instanceIdentity.logoLeft,
|
||||||
},
|
logoMargin: (store) => store.instanceIdentity.logoMargin,
|
||||||
hideSitename() {
|
name: (store) => store.instanceIdentity.name,
|
||||||
return useInstanceStore().hideSitename
|
hideSitename: (store) => store.instanceIdentity.hideSitename,
|
||||||
},
|
}),
|
||||||
logoLeft() {
|
|
||||||
return useInstanceStore().logoLeft
|
|
||||||
},
|
|
||||||
currentUser() {
|
currentUser() {
|
||||||
return this.$store.state.users.currentUser
|
return this.$store.state.users.currentUser
|
||||||
},
|
},
|
||||||
privateMode() {
|
|
||||||
return useInstanceStore().private
|
|
||||||
},
|
|
||||||
shouldConfirmLogout() {
|
shouldConfirmLogout() {
|
||||||
return this.$store.getters.mergedConfig.modalOnLogout
|
return this.$store.getters.mergedConfig.modalOnLogout
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ import { chunk, debounce, trim } from 'lodash'
|
||||||
import { defineAsyncComponent } from 'vue'
|
import { defineAsyncComponent } from 'vue'
|
||||||
|
|
||||||
import Popover from 'src/components/popover/popover.vue'
|
import Popover from 'src/components/popover/popover.vue'
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
|
||||||
import { useEmojiStore } from 'src/stores/emoji.js'
|
import { useEmojiStore } from 'src/stores/emoji.js'
|
||||||
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { ensureFinalFallback } from '../../i18n/languages.js'
|
import { ensureFinalFallback } from '../../i18n/languages.js'
|
||||||
import Checkbox from '../checkbox/checkbox.vue'
|
import Checkbox from '../checkbox/checkbox.vue'
|
||||||
import StillImage from '../still-image/still-image.vue'
|
import StillImage from '../still-image/still-image.vue'
|
||||||
|
|
|
||||||
|
|
@ -17,12 +17,11 @@ const LoginForm = {
|
||||||
error: false,
|
error: false,
|
||||||
}),
|
}),
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(useInstanceStore, ['server'])
|
|
||||||
...mapStores(useOAuthStore),
|
|
||||||
...mapState({
|
...mapState({
|
||||||
registrationOpen: (state) => useInstanceStore().registrationOpen,
|
|
||||||
loggingIn: (state) => state.users.loggingIn,
|
loggingIn: (state) => state.users.loggingIn,
|
||||||
}),
|
}),
|
||||||
|
...mapPiniaState(useOAuthStore, ['clientId', 'clientSecret']),
|
||||||
|
...mapPiniaState(useInstanceStore, ['server', 'registrationOpen']),
|
||||||
...mapPiniaState(useAuthFlowStore, {
|
...mapPiniaState(useAuthFlowStore, {
|
||||||
isTokenAuth: (store) => store.requiredToken,
|
isTokenAuth: (store) => store.requiredToken,
|
||||||
isPasswordAuth: (store) => !store.requiredToken,
|
isPasswordAuth: (store) => !store.requiredToken,
|
||||||
|
|
@ -30,6 +29,7 @@ const LoginForm = {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(useAuthFlowStore, ['requireMFA', 'login']),
|
...mapActions(useAuthFlowStore, ['requireMFA', 'login']),
|
||||||
|
...mapActions(useOAuthStore, ['ensureAppToken']),
|
||||||
submit() {
|
submit() {
|
||||||
this.isTokenAuth ? this.submitToken() : this.submitPassword()
|
this.isTokenAuth ? this.submitToken() : this.submitPassword()
|
||||||
},
|
},
|
||||||
|
|
@ -41,10 +41,10 @@ const LoginForm = {
|
||||||
|
|
||||||
// NOTE: we do not really need the app token, but obtaining a token and
|
// NOTE: we do not really need the app token, but obtaining a token and
|
||||||
// calling verify_credentials is the only way to ensure the app still works.
|
// calling verify_credentials is the only way to ensure the app still works.
|
||||||
this.oauthStore.ensureAppToken().then(() => {
|
this.ensureAppToken().then(() => {
|
||||||
const app = {
|
const app = {
|
||||||
clientId: this.oauthStore.clientId,
|
clientId: this.clientId,
|
||||||
clientSecret: this.oauthStore.clientSecret,
|
clientSecret: this.clientSecret,
|
||||||
}
|
}
|
||||||
oauthApi.login({ ...app, ...data })
|
oauthApi.login({ ...app, ...data })
|
||||||
})
|
})
|
||||||
|
|
@ -54,10 +54,10 @@ const LoginForm = {
|
||||||
|
|
||||||
// NOTE: we do not really need the app token, but obtaining a token and
|
// NOTE: we do not really need the app token, but obtaining a token and
|
||||||
// calling verify_credentials is the only way to ensure the app still works.
|
// calling verify_credentials is the only way to ensure the app still works.
|
||||||
this.oauthStore.ensureAppToken().then(() => {
|
this.ensureAppToken().then(() => {
|
||||||
const app = {
|
const app = {
|
||||||
clientId: this.oauthStore.clientId,
|
clientId: this.clientId,
|
||||||
clientSecret: this.oauthStore.clientSecret,
|
clientSecret: this.clientSecret,
|
||||||
}
|
}
|
||||||
|
|
||||||
oauthApi
|
oauthApi
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import fileSizeFormatService from '../../services/file_size_format/file_size_format.js'
|
import fileSizeFormatService from '../../services/file_size_format/file_size_format.js'
|
||||||
import statusPosterService from '../../services/status_poster/status_poster.service.js'
|
import statusPosterService from '../../services/status_poster/status_poster.service.js'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
|
||||||
|
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
import { faCircleNotch, faUpload } from '@fortawesome/free-solid-svg-icons'
|
import { faCircleNotch, faUpload } from '@fortawesome/free-solid-svg-icons'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ export default {
|
||||||
}),
|
}),
|
||||||
computed: {
|
computed: {
|
||||||
...mapStores(useOAuthStore),
|
...mapStores(useOAuthStore),
|
||||||
...mapState(useOAuthStore, ['clientId','clientSecret']),
|
...mapState(useOAuthStore, ['clientId', 'clientSecret']),
|
||||||
...mapState(useAuthFlowStore, ['settings']),
|
...mapState(useAuthFlowStore, ['settings']),
|
||||||
...mapState(useInstanceStore, ['server']),
|
...mapState(useInstanceStore, ['server']),
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,8 @@ export default {
|
||||||
...mapState(useAuthFlowStore, {
|
...mapState(useAuthFlowStore, {
|
||||||
authSettings: (store) => store.settings,
|
authSettings: (store) => store.settings,
|
||||||
}),
|
}),
|
||||||
...mapState(useInstanceStore, ['server'])
|
...mapState(useInstanceStore, ['server']),
|
||||||
...mapStores(useOAuthStore),
|
...mapStores(useOAuthStore),
|
||||||
...mapState({
|
|
||||||
instance: 'instance',
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(useAuthFlowStore, ['requireRecovery', 'abortMFA', 'login']),
|
...mapActions(useAuthFlowStore, ['requireRecovery', 'abortMFA', 'login']),
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@ import DraftCloser from 'src/components/draft_closer/draft_closer.vue'
|
||||||
import Gallery from 'src/components/gallery/gallery.vue'
|
import Gallery from 'src/components/gallery/gallery.vue'
|
||||||
import Popover from 'src/components/popover/popover.vue'
|
import Popover from 'src/components/popover/popover.vue'
|
||||||
import { pollFormToMasto } from 'src/services/poll/poll.service.js'
|
import { pollFormToMasto } from 'src/services/poll/poll.service.js'
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
|
||||||
import { useEmojiStore } from 'src/stores/emoji.js'
|
import { useEmojiStore } from 'src/stores/emoji.js'
|
||||||
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
import { useMediaViewerStore } from 'src/stores/media_viewer.js'
|
import { useMediaViewerStore } from 'src/stores/media_viewer.js'
|
||||||
import { propsToNative } from '../../services/attributes_helper/attributes_helper.service.js'
|
import { propsToNative } from '../../services/attributes_helper/attributes_helper.service.js'
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
remoteInteractionLink() {
|
remoteInteractionLink() {
|
||||||
return this.$store.getters.remoteInteractionLink({
|
return useInstanceStore().getRemoteInteractionLink({
|
||||||
statusId: this.status.id,
|
statusId: this.status.id,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import Cookies from 'js-cookie'
|
import Cookies from 'js-cookie'
|
||||||
import { set } from 'lodash'
|
import { set } from 'lodash'
|
||||||
|
|
||||||
import { useI18nStore } from 'src/stores/i18n.js'
|
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
|
||||||
import { useEmojiStore } from 'src/stores/emoji.js'
|
import { useEmojiStore } from 'src/stores/emoji.js'
|
||||||
|
import { useI18nStore } from 'src/stores/i18n.js'
|
||||||
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
import messages from '../i18n/messages'
|
import messages from '../i18n/messages'
|
||||||
import localeService from '../services/locale/locale.service.js'
|
import localeService from '../services/locale/locale.service.js'
|
||||||
import { applyConfig } from '../services/style_setter/style_setter.js'
|
import { applyConfig } from '../services/style_setter/style_setter.js'
|
||||||
|
|
@ -49,7 +49,10 @@ const config = {
|
||||||
return {
|
return {
|
||||||
...defaultState,
|
...defaultState,
|
||||||
...Object.fromEntries(
|
...Object.fromEntries(
|
||||||
instanceDefaultProperties.map((key) => [key, useInstanceStore()[key]]),
|
instanceDefaultProperties.map((key) => [
|
||||||
|
key,
|
||||||
|
useInstanceStore()[key],
|
||||||
|
]),
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,9 @@ import {
|
||||||
} from 'lodash'
|
} from 'lodash'
|
||||||
|
|
||||||
import { declarations } from 'src/modules/config_declaration'
|
import { declarations } from 'src/modules/config_declaration'
|
||||||
|
import { useEmojiStore } from 'src/stores/emoji.js'
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
import { useEmojiStore } from 'src/stores/emoji.js'
|
|
||||||
import { useOAuthStore } from 'src/stores/oauth.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
||||||
import apiService from '../services/api/api.service.js'
|
import apiService from '../services/api/api.service.js'
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
|
||||||
|
|
||||||
import { ensureFinalFallback } from 'src/i18n/languages.js'
|
import { ensureFinalFallback } from 'src/i18n/languages.js'
|
||||||
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
|
||||||
import { annotationsLoader } from 'virtual:pleroma-fe/emoji-annotations'
|
import { annotationsLoader } from 'virtual:pleroma-fe/emoji-annotations'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -113,25 +113,13 @@ export const useInstanceStore = defineStore('instance', {
|
||||||
instanceDomain(state) {
|
instanceDomain(state) {
|
||||||
return new URL(this.server).hostname
|
return new URL(this.server).hostname
|
||||||
},
|
},
|
||||||
remoteInteractionLink(state) {
|
|
||||||
const server = this.server.endsWith('/')
|
|
||||||
? this.server.slice(0, -1)
|
|
||||||
: this.server
|
|
||||||
const link = server + REMOTE_INTERACTION_URL
|
|
||||||
|
|
||||||
return ({ statusId, nickname }) => {
|
|
||||||
if (statusId) {
|
|
||||||
return `${link}?status_id=${statusId}`
|
|
||||||
} else {
|
|
||||||
return `${link}?nickname=${nickname}`
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
set({ path, name, value }) {
|
set({ path, name, value }) {
|
||||||
if (get(defaultState, path ?? name) === undefined)
|
if (get(defaultState, path ?? name) === undefined)
|
||||||
console.error(`Unknown instance option ${path ?? name}, value: ${value}`)
|
console.error(
|
||||||
|
`Unknown instance option ${path ?? name}, value: ${value}`,
|
||||||
|
)
|
||||||
set(this, path ?? name, value)
|
set(this, path ?? name, value)
|
||||||
switch (name) {
|
switch (name) {
|
||||||
case 'name':
|
case 'name':
|
||||||
|
|
@ -153,5 +141,17 @@ export const useInstanceStore = defineStore('instance', {
|
||||||
console.warn("Can't load known domains\n", e)
|
console.warn("Can't load known domains\n", e)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getRemoteInteractionLink({ statusId, nickname }) {
|
||||||
|
const server = this.server.endsWith('/')
|
||||||
|
? this.server.slice(0, -1)
|
||||||
|
: this.server
|
||||||
|
const link = server + REMOTE_INTERACTION_URL
|
||||||
|
|
||||||
|
if (statusId) {
|
||||||
|
return `${link}?status_id=${statusId}`
|
||||||
|
} else {
|
||||||
|
return `${link}?nickname=${nickname}`
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue