@@ -501,6 +501,7 @@ import { vOnClickOutside } from "@vueuse/components";
501501import { Container , Draggable } from " vue3-smooth-dnd" ;
502502// @ts-expect-error library has no types
503503import { VueTagsInput } from " @vojtechlanka/vue-tags-input" ;
504+ import { useSettingsStore } from " @/stores/settings" ;
504505
505506const props = defineProps <{
506507 card: Card | null ;
@@ -562,6 +563,7 @@ const selectedColor = ref("");
562563
563564const dueDate: Ref <Date | null > = ref (null );
564565const isDueDateCounterRelative = ref (false );
566+ const settingsStore = useSettingsStore ();
565567const isDueDateCompleted = ref (false );
566568
567569const tag = ref (" " );
@@ -623,7 +625,7 @@ const beforeTagAdd = ({ tag, addTag }: any) => {
623625 );
624626
625627 if (! existingTag ) {
626- if (matches .length === 1 ) {
628+ if (matches .length === 1 && matches [ 0 ] ) {
627629 tag .text = matches [0 ].text ;
628630 tag .id = matches [0 ].id ;
629631 tag .color = matches [0 ].color ;
@@ -702,7 +704,9 @@ const updateTask = (index: number) => {
702704 ! / \S / .test (currentlyEditingTaskName .value );
703705 if (taskNameEmpty || currentlyEditingTaskIndex .value === - 1 ) return ;
704706
705- tasks .value [index ].name = currentlyEditingTaskName .value ;
707+ if (tasks .value [index ]) {
708+ tasks .value [index ].name = currentlyEditingTaskName .value ;
709+ }
706710
707711 currentlyEditingTaskIndex .value = - 1 ;
708712 currentlyEditingTaskName .value = " " ;
@@ -803,7 +807,9 @@ watch(props, (newVal) => {
803807 // @ts-expect-error TODO: improve due date handling/types
804808 dueDate .value = newVal .card .dueDate || null ;
805809 isDueDateCounterRelative .value =
806- newVal .card .isDueDateCounterRelative || false ;
810+ newVal .card .isDueDateCounterRelative !== undefined
811+ ? newVal .card .isDueDateCounterRelative
812+ : settingsStore .defaultRelativeDueDatesEnabled ;
807813 isDueDateCompleted .value = newVal .card .isDueDateCompleted || false ;
808814
809815 tags .value = newVal .card .tags || [];
0 commit comments