diff --git a/src/boot/after_store.js b/src/boot/after_store.js index af457cb4..d27d4fb8 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -183,10 +183,10 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => { copyInstanceOption('renderMisskeyMarkdown') copyInstanceOption('sidebarRight') - if (typeof config.backendCommitUrl !== 'undefined') + if (config.backendCommitUrl) copyInstanceOption('backendCommitUrl') - if (typeof config.frontendCommitUrl !== 'undefined') + if (config.frontendCommitUrl) copyInstanceOption('frontendCommitUrl') return store.dispatch('setTheme', config['theme']) diff --git a/src/components/settings_modal/tabs/version_tab.js b/src/components/settings_modal/tabs/version_tab.js index 2a8999f9..97791a3a 100644 --- a/src/components/settings_modal/tabs/version_tab.js +++ b/src/components/settings_modal/tabs/version_tab.js @@ -1,5 +1,9 @@ import { extractCommit } from 'src/services/version/version.service' +function joinURL(base, subpath) { + return URL.parse(subpath, base)?.href || "invalid base URL" +} + const VersionTab = { data () { const instance = this.$store.state.instance @@ -12,10 +16,10 @@ const VersionTab = { }, computed: { frontendVersionLink () { - return this.frontendCommitUrl + this.frontendVersion + return joinURL(this.frontendCommitUrl, this.frontendVersion) }, backendVersionLink () { - return this.backendCommitUrl + extractCommit(this.backendVersion) + return joinURL(this.backendCommitUrl, extractCommit(this.backendVersion)) } } } diff --git a/src/components/status_body/status_body.js b/src/components/status_body/status_body.js index 19cec6c6..7ff6c3aa 100644 --- a/src/components/status_body/status_body.js +++ b/src/components/status_body/status_body.js @@ -41,7 +41,8 @@ const StatusContent = { postLength: this.status.text.length, parseReadyDone: false, renderMisskeyMarkdown, - translateFrom: null + translateFrom: null, + translating: false } }, computed: { @@ -135,7 +136,10 @@ const StatusContent = { }, translateStatus () { const translateTo = this.$store.getters.mergedConfig.translationLanguage || this.$store.state.instance.interfaceLanguage - this.$store.dispatch('translateStatus', { id: this.status.id, language: translateTo, from: this.translateFrom }) + this.translating = true + this.$store.dispatch( + 'translateStatus', { id: this.status.id, language: translateTo, from: this.translateFrom } + ).finally(() => { this.translating = false }) } } } diff --git a/src/components/status_body/status_body.vue b/src/components/status_body/status_body.vue index 882b38c5..ba9a3ded 100644 --- a/src/components/status_body/status_body.vue +++ b/src/components/status_body/status_body.vue @@ -91,6 +91,7 @@ {{ ' ' }}