pass 4 - non-obvious changes
This commit is contained in:
parent
617613dfb4
commit
095abb2914
14 changed files with 83 additions and 87 deletions
|
|
@ -113,25 +113,13 @@ export const useInstanceStore = defineStore('instance', {
|
|||
instanceDomain(state) {
|
||||
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: {
|
||||
set({ path, name, value }) {
|
||||
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)
|
||||
switch (name) {
|
||||
case 'name':
|
||||
|
|
@ -153,5 +141,17 @@ export const useInstanceStore = defineStore('instance', {
|
|||
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