fix: Fixed some null issues + added props attribute for dialog prop passing (#2659)
This commit is contained in:
parent
df8349e352
commit
8b4b2d6656
@ -91,9 +91,9 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
currentPrompt(val, old) {
|
currentPrompt(val, old) {
|
||||||
this.active = val.prompt === "search";
|
this.active = val?.prompt === "search";
|
||||||
|
|
||||||
if (old.prompt === "search" && !this.active) {
|
if (old?.prompt === "search" && !this.active) {
|
||||||
if (this.reload) {
|
if (this.reload) {
|
||||||
this.setReload(true);
|
this.setReload(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -135,7 +135,7 @@ export default {
|
|||||||
...mapState(["user"]),
|
...mapState(["user"]),
|
||||||
...mapGetters(["isLogged", "currentPrompt"]),
|
...mapGetters(["isLogged", "currentPrompt"]),
|
||||||
active() {
|
active() {
|
||||||
return this.currentPrompt.prompt === "sidebar";
|
return this.currentPrompt?.prompt === "sidebar";
|
||||||
},
|
},
|
||||||
signup: () => signup,
|
signup: () => signup,
|
||||||
version: () => version,
|
version: () => version,
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
<slot />
|
<slot />
|
||||||
|
|
||||||
<div id="dropdown" :class="{ active: this.currentPrompt.prompt === 'more' }">
|
<div id="dropdown" :class="{ active: this.currentPromptName === 'more' }">
|
||||||
<slot name="actions" />
|
<slot name="actions" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
<div
|
<div
|
||||||
class="overlay"
|
class="overlay"
|
||||||
v-show="this.currentPrompt.prompt == 'more'"
|
v-show="this.currentPromptName == 'more'"
|
||||||
@click="$store.commit('closeHovers')"
|
@click="$store.commit('closeHovers')"
|
||||||
/>
|
/>
|
||||||
</header>
|
</header>
|
||||||
@ -54,7 +54,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(["currentPrompt"]),
|
...mapGetters(["currentPromptName"]),
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<component ref="getCurrentPrompt" :is="getCurrentPrompt"></component>
|
<component v-if="showOverlay" :ref="currentPromptName" :is="currentPromptName" v-bind="currentPrompt.props"></component>
|
||||||
<div v-show="showOverlay" @click="resetPrompts" class="overlay"></div>
|
<div v-show="showOverlay" @click="resetPrompts" class="overlay"></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -83,7 +83,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["plugins"]),
|
...mapState(["plugins"]),
|
||||||
...mapGetters(["currentPrompt"]),
|
...mapGetters(["currentPrompt", "currentPromptName"]),
|
||||||
showOverlay: function () {
|
showOverlay: function () {
|
||||||
return (
|
return (
|
||||||
this.currentPrompt !== null &&
|
this.currentPrompt !== null &&
|
||||||
|
|||||||
@ -46,6 +46,9 @@ const getters = {
|
|||||||
currentPrompt: (state) => {
|
currentPrompt: (state) => {
|
||||||
return state.prompts.length > 0 ? state.prompts[state.prompts.length - 1] : null;
|
return state.prompts.length > 0 ? state.prompts[state.prompts.length - 1] : null;
|
||||||
},
|
},
|
||||||
|
currentPromptName: (_, getters) => {
|
||||||
|
return getters.currentPrompt?.prompt;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export default getters;
|
export default getters;
|
||||||
|
|||||||
@ -13,12 +13,14 @@ const mutations = {
|
|||||||
state.showShell = !state.showShell;
|
state.showShell = !state.showShell;
|
||||||
},
|
},
|
||||||
showHover: (state, value) => {
|
showHover: (state, value) => {
|
||||||
|
console.log(value);
|
||||||
if (typeof value !== "object") {
|
if (typeof value !== "object") {
|
||||||
state.show = value;
|
state.show = value;
|
||||||
state.prompts.push({
|
state.prompts.push({
|
||||||
prompt: value,
|
prompt: value,
|
||||||
confirm: null,
|
confirm: null,
|
||||||
action: null
|
action: null,
|
||||||
|
props: {}
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,7 +38,7 @@ export default {
|
|||||||
$route: function () {
|
$route: function () {
|
||||||
this.$store.commit("resetSelected");
|
this.$store.commit("resetSelected");
|
||||||
this.$store.commit("multiple", false);
|
this.$store.commit("multiple", false);
|
||||||
if (this.currentPrompt.prompt !== "success")
|
if (this.currentPrompt?.prompt !== "success")
|
||||||
this.$store.commit("closeHovers");
|
this.$store.commit("closeHovers");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@ -196,7 +196,7 @@ export default {
|
|||||||
return api.getDownloadURL(this.req, true);
|
return api.getDownloadURL(this.req, true);
|
||||||
},
|
},
|
||||||
showMore() {
|
showMore() {
|
||||||
return this.currentPrompt.prompt === "more";
|
return this.currentPrompt?.prompt === "more";
|
||||||
},
|
},
|
||||||
isResizeEnabled() {
|
isResizeEnabled() {
|
||||||
return resizePreview;
|
return resizePreview;
|
||||||
|
|||||||
@ -37,7 +37,7 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="this.currentPrompt.prompt === 'deleteUser'" class="card floating">
|
<div v-if="this.currentPromptName === 'deleteUser'" class="card floating">
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
<p>Are you sure you want to delete this user?</p>
|
<p>Are you sure you want to delete this user?</p>
|
||||||
</div>
|
</div>
|
||||||
@ -89,7 +89,7 @@ export default {
|
|||||||
return this.$route.path === "/settings/users/new";
|
return this.$route.path === "/settings/users/new";
|
||||||
},
|
},
|
||||||
...mapState(["loading"]),
|
...mapState(["loading"]),
|
||||||
...mapGetters(["currentPrompt"])
|
...mapGetters(["currentPrompt", "currentPromptName"])
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
$route: "fetchData",
|
$route: "fetchData",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user