Skip to content

Commit

Permalink
Merge branch '94-Modal-backdrop-doesnt-disappear' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
floscher committed Jun 25, 2024
2 parents 9433cf1 + 2c41e34 commit 63dece6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions client/src/components/AiSummaryDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { t } from "@client/plugins/i18n.js";
import type { AiSummaryData } from "@fumix/fu-blog-common";
import { Modal } from "bootstrap";
import type { PropType } from "vue";
import { watch } from "vue";
import { ref, watch } from "vue";
const props = defineProps({
show: {
Expand All @@ -43,12 +43,16 @@ const props = defineProps({
},
});
const modalOpen = ref<boolean>(false);
const emits = defineEmits(["acceptDescription", "canceled", "addTag", "removeAiSummary", "setKeyvisual"]);
watch(props, () => {
const myModal = new Modal(document.getElementById("aiModal") || "", {});
const show = props.show;
show ? myModal?.show() : myModal.hide();
if (modalOpen.value != props.show) {
const myModal = new Modal(document.getElementById("aiModal") || "", { backdrop: "static" });
props.show ? myModal?.show() : myModal.hide();
modalOpen.value = props.show || false;
}
});
const acceptDescription = (description: string) => {
Expand Down

0 comments on commit 63dece6

Please sign in to comment.