Skip to content

Commit

Permalink
alert user that adding item when no view is selected is impossible
Browse files Browse the repository at this point in the history
  • Loading branch information
rouk1 committed Oct 3, 2024
1 parent 6c7193f commit 3dea59d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions frontend/src/views/ProjectView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,19 @@ function onFocusMode() {
isInFocusMode.value = !isInFocusMode.value;
}
function displayItem(key: string) {
if (projectStore.currentView) {
projectStore.displayKey(projectStore.currentView, key);
} else {
toastsStore.addToast("No view selected", "error");
}
}
function onItemDrop(event: DragEvent) {
isDropIndicatorVisible.value = false;
if (event.dataTransfer) {
const key = event.dataTransfer.getData("key");
if (projectStore.currentView) {
projectStore.displayKey(projectStore.currentView, key);
}
displayItem(key);
}
}
Expand All @@ -59,9 +65,7 @@ function onDragLeave(event: DragEvent) {
}
function onItemSelected(key: string) {
if (projectStore.currentView) {
projectStore.displayKey(projectStore.currentView, key);
}
displayItem(key);
}
function onViewSelected(view: string) {
Expand Down

0 comments on commit 3dea59d

Please sign in to comment.