Tell the control system if it's preview/dev mode.
This commit is contained in:
parent
2206a46453
commit
6d3164f5be
3 changed files with 25 additions and 10 deletions
21
src/App.vue
21
src/App.vue
|
|
@ -1,7 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="maximize_size">
|
<div class="maximize_size">
|
||||||
<LoginCard v-if="!is_authed" />
|
<LoginCard v-if="!is_authed" />
|
||||||
<MainView v-else />
|
<MainView
|
||||||
|
v-else
|
||||||
|
:preview_mode="is_preview"
|
||||||
|
:dev_mode="is_dev"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -22,15 +26,18 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
is_dev() {
|
||||||
|
let params = new URLSearchParams(window.location.search.slice(1));
|
||||||
|
return params.get(`dev`) != null && params.get(`dev`) !== `false`
|
||||||
|
},
|
||||||
|
is_preview() {
|
||||||
|
let params = new URLSearchParams(window.location.search.slice(1));
|
||||||
|
return params.get(`preview`) != null && params.get(`preview`) !== `false`
|
||||||
|
},
|
||||||
is_authed() {
|
is_authed() {
|
||||||
let params = new URLSearchParams(window.location.hash.slice(1));
|
let params = new URLSearchParams(window.location.hash.slice(1));
|
||||||
let qparams = new URLSearchParams(window.location.search.slice(1));
|
|
||||||
|
|
||||||
if ( qparams.get(`dev`) != null && qparams.get(`dev`) !== `false` ) {
|
if ( this.is_dev || this.is_preview ) { return true; };
|
||||||
return true;
|
|
||||||
} else if ( qparams.get(`preview`) != null && qparams.get(`preview`) !== `false`) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check to ensure the authorization was a success
|
// Check to ensure the authorization was a success
|
||||||
if (params.get(`access_token`)) {
|
if (params.get(`access_token`)) {
|
||||||
|
|
|
||||||
|
|
@ -50,9 +50,11 @@
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: `ControlBar`,
|
name: `ControlBar`,
|
||||||
props: [
|
props: {
|
||||||
'data_exists'
|
data_exists: Boolean,
|
||||||
],
|
dev: Boolean,
|
||||||
|
preview: Boolean,
|
||||||
|
},
|
||||||
components: {},
|
components: {},
|
||||||
data() { return {
|
data() { return {
|
||||||
error: ``,
|
error: ``,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div id="main_screen">
|
<div id="main_screen">
|
||||||
<Control
|
<Control
|
||||||
|
:dev="dev_mode"
|
||||||
|
:preview="preview_mode"
|
||||||
@export-attempt="handle_export"
|
@export-attempt="handle_export"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -11,6 +13,10 @@ import ControlCard from "./ControlBar.vue"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: ``,
|
name: ``,
|
||||||
|
props: {
|
||||||
|
preview_mode: Boolean,
|
||||||
|
dev_mode: Boolean,
|
||||||
|
},
|
||||||
components: {
|
components: {
|
||||||
Control: ControlCard
|
Control: ControlCard
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue