Replace deprecated document.domain with location.hostname

This commit is contained in:
Kasper Seweryn 2022-05-05 21:07:20 +00:00 committed by Georg Krause
parent 30731580c1
commit 40c7e08744
2 changed files with 3 additions and 10 deletions

View File

@ -111,7 +111,7 @@ export default {
},
error: '',
isLoading: false,
domain: document.domain
domain: location.hostname
}
},
computed: {
@ -134,7 +134,7 @@ export default {
},
methods: {
async submit () {
if (document.domain === this.$store.getters['instance/domain']) {
if (location.hostname === this.$store.getters['instance/domain']) {
return await this.submitSession()
} else {
this.isLoading = true

View File

@ -139,14 +139,7 @@ const store: Module<State, RootState> = {
const instanceUrl = state.instanceUrl ?? location.origin
return instanceUrl + relativeUrl
},
domain: (state) => {
if (!state.instanceUrl) return null
const url = state.instanceUrl
const parser = document.createElement('a')
parser.href = url
return parser.hostname
},
domain: (state) => new URL(state.instanceUrl ?? location.origin).hostname,
appDomain: () => location.hostname
},
actions: {