Fix env variables

This commit is contained in:
Kasper Seweryn 2022-02-21 23:23:13 +01:00
parent 873e498031
commit 4ce7386128
No known key found for this signature in database
GPG Key ID: B2BA6FA597595C00
5 changed files with 6 additions and 6 deletions

View File

@ -272,7 +272,7 @@ export default {
// 3. use the current url // 3. use the current url
const defaultInstanceUrl = const defaultInstanceUrl =
this.$store.state.instance.frontSettings.defaultServerUrl || this.$store.state.instance.frontSettings.defaultServerUrl ||
process.env.VUE_APP_INSTANCE_URL || this.$store.getters['instance/defaultUrl']() import.meta.env.VUE_APP_INSTANCE_URL || this.$store.getters['instance/defaultUrl']()
this.$store.commit('instance/instanceUrl', defaultInstanceUrl) this.$store.commit('instance/instanceUrl', defaultInstanceUrl)
} else { } else {
// needed to trigger initialization of axios / service worker // needed to trigger initialization of axios / service worker

View File

@ -590,7 +590,7 @@ export default {
) )
}, },
production () { production () {
return process.env.NODE_ENV === 'production' return import.meta.env.NODE_ENV === 'production'
} }
}, },
watch: { watch: {

View File

@ -134,7 +134,7 @@ export default {
return _.get(this.nodeinfo, 'metadata.library.anonymousCanListen', false) return _.get(this.nodeinfo, 'metadata.library.anonymousCanListen', false)
}, },
iframeSrc () { iframeSrc () {
let base = process.env.BASE_URL let base = import.meta.env.BASE_URL
if (base.startsWith('/')) { if (base.startsWith('/')) {
// include hostname/protocol too so that the iframe link is absolute // include hostname/protocol too so that the iframe link is absolute
base = `${window.location.protocol}//${window.location.host}${base}` base = `${window.location.protocol}//${window.location.host}${base}`

View File

@ -4,8 +4,8 @@ import { register } from 'register-service-worker'
import store from './store' import store from './store'
if (process.env.NODE_ENV === 'production') { if (import.meta.env.NODE_ENV === 'production') {
register(`${process.env.BASE_URL}service-worker.js`, { register(`${import.meta.env.BASE_URL}service-worker.js`, {
registrationOptions: { scope: '/' }, registrationOptions: { scope: '/' },
ready () { ready () {
console.log( console.log(

View File

@ -20,7 +20,7 @@ export default {
state: { state: {
maxEvents: 200, maxEvents: 200,
frontSettings: {}, frontSettings: {},
instanceUrl: process.env.VUE_APP_INSTANCE_URL, instanceUrl: import.meta.env.VUE_APP_INSTANCE_URL,
events: [], events: [],
knownInstances: [], knownInstances: [],
nodeinfo: null, nodeinfo: null,