fix bug
This commit is contained in:
15
src/App.vue
15
src/App.vue
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, onUnmounted, computed, nextTick } from "vue";
|
||||
import { ref, onMounted, onUnmounted, computed, nextTick, watch } from "vue";
|
||||
import { load } from "@tauri-apps/plugin-store";
|
||||
import { open, save } from "@tauri-apps/plugin-dialog";
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
@@ -80,6 +80,16 @@ const handleEventMouseMove = (e: MouseEvent) => {
|
||||
const handleEventMouseLeave = () => {
|
||||
hoveredEventDetails.value = null;
|
||||
};
|
||||
|
||||
watch(dayEvents, (newEvents) => {
|
||||
if (hoveredEventDetails.value) {
|
||||
const exists = newEvents.some(ev => ev.id === hoveredEventDetails.value?.event.id);
|
||||
if (!exists) {
|
||||
hoveredEventDetails.value = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const timelineRef = ref<HTMLElement | null>(null);
|
||||
|
||||
const rulerHeight = computed(() => TOTAL_MINUTES * timelineZoom.value);
|
||||
@@ -167,6 +177,9 @@ const selectCalendarDate = (date: Date) => {
|
||||
lockedImage.value = null;
|
||||
previewSrc.value = "";
|
||||
hoveredTime.value = null;
|
||||
hoveredEventDetails.value = null;
|
||||
dayEvents.value = [];
|
||||
timelineImages.value = [];
|
||||
updateCurrentMinute();
|
||||
loadTimeline(true); loadEvents();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user