Skip to content

Commit

Permalink
Fix missing project name on create
Browse files Browse the repository at this point in the history
  • Loading branch information
Sébastien LeBlanc committed Oct 11, 2023
1 parent 7b2876f commit c9d1c64
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion src/components/TimeEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,15 @@ const emit = defineEmits<{
(e: 'add'): void;
}>();
const model = ref(Object.create(null, Object.getOwnPropertyDescriptors(props.entry)));
const model = ref();
watch(
() => props.entry.project,
() => {
model.value = Object.create(null, Object.getOwnPropertyDescriptors(props.entry));
},
{ immediate: true },
);
const placeholder = ref('00:00:00');
const computedDate = computed(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/stores/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ export const useIndexStore = defineStore('store', () => {
return $moment(selectedDay.value).endOf('week').toDate();
});
const projects = useCollection<Project>(
user.value ? query(collection(db, 'projects'), where('user', '==', user.value?.uid)) : null,
computed(() => (user.value ? query(collection(db, 'projects'), where('user', '==', user.value?.uid)) : null)),
{
ssrKey: 'projects',
},
);
const priorities = useCollection<Priority>(
user.value ? query(collection(db, 'priorities'), where('user', '==', user.value?.uid)) : null,
computed(() => (user.value ? query(collection(db, 'priorities'), where('user', '==', user.value?.uid)) : null)),
{
ssrKey: 'priorities',
},
Expand Down

0 comments on commit c9d1c64

Please sign in to comment.