diff --git a/resources/js/Components/Common/Notification/Notification.vue b/resources/js/Components/Common/Notification/Notification.vue new file mode 100644 index 00000000..65eb7f33 --- /dev/null +++ b/resources/js/Components/Common/Notification/Notification.vue @@ -0,0 +1,62 @@ + + + diff --git a/resources/js/Components/Common/Tag/TagDropdown.vue b/resources/js/Components/Common/Tag/TagDropdown.vue index 39939ef9..1de5a08b 100644 --- a/resources/js/Components/Common/Tag/TagDropdown.vue +++ b/resources/js/Components/Common/Tag/TagDropdown.vue @@ -61,7 +61,9 @@ const filteredTags = computed(() => { async function addTagIfNoneExists() { if (searchValue.value.length > 0 && filteredTags.value.length === 0) { const newTag = await tagsStore.createTag(searchValue.value); - addOrRemoveTagFromSelection(newTag.id); + if (newTag) { + addOrRemoveTagFromSelection(newTag.id); + } searchValue.value = ''; } else { if (highlightedItemId.value) { diff --git a/resources/js/Components/NotificationContainer.vue b/resources/js/Components/NotificationContainer.vue new file mode 100644 index 00000000..ddead6a2 --- /dev/null +++ b/resources/js/Components/NotificationContainer.vue @@ -0,0 +1,22 @@ + + + diff --git a/resources/js/Layouts/AppLayout.vue b/resources/js/Layouts/AppLayout.vue index be357608..d136c19e 100644 --- a/resources/js/Layouts/AppLayout.vue +++ b/resources/js/Layouts/AppLayout.vue @@ -23,6 +23,7 @@ import { useTasksStore } from '@/utils/useTasks'; import { useCurrentTimeEntryStore } from '@/utils/useCurrentTimeEntry'; import { useClientsStore } from '@/utils/useClients'; import { useMembersStore } from '@/utils/useMembers'; +import NotificationContainer from '@/Components/NotificationContainer.vue'; defineProps({ title: String, @@ -39,7 +40,9 @@ onMounted(async () => { diff --git a/resources/js/Pages/Time.vue b/resources/js/Pages/Time.vue index 037b519c..df3f10d8 100644 --- a/resources/js/Pages/Time.vue +++ b/resources/js/Pages/Time.vue @@ -47,7 +47,7 @@ const groupedTimeEntries = computed(() => {