Skip to content

Commit

Permalink
fix content element update
Browse files Browse the repository at this point in the history
  • Loading branch information
uidp committed Aug 8, 2024
1 parent 79fcd9a commit c0db627
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/data/board/ContentElementState.composable.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { watchDebounced } from "@vueuse/core";
import { computed, ComputedRef, Ref, ref, toRef, unref } from "vue";
import { computed, ComputedRef, Ref, ref, toRef } from "vue";
import { AnyContentElement } from "@/types/board/ContentElement";
import { useCardStore } from "./Card.store";

Expand All @@ -13,14 +13,14 @@ export const useContentElementState = <T extends AnyContentElement>(
const cardStore = useCardStore();
const _elementRef: Ref<T> = toRef(props, "element");

const modelValue = ref<T["content"]>(unref<T>(_elementRef).content);
const modelValue = ref(_elementRef.value.content);

const computedElement: ComputedRef<T> = computed(() => _elementRef.value);

const isLoading = ref<boolean>(false);

watchDebounced<T["content"]>(
modelValue,
modelValue.value,
async (modelValue) => {
cardStore.updateElementRequest({
element: {
Expand Down

0 comments on commit c0db627

Please sign in to comment.