Skip to content

Commit

Permalink
Handle schlag parts in watcher
Browse files Browse the repository at this point in the history
  • Loading branch information
ahocevar committed Sep 4, 2024
1 parent 9758f4f commit ff69c6b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/components/TheEntryList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,23 @@
<script setup>
import { useSchlag } from '../composables/useSchlag.js';
import { useDataEntries } from '../composables/useDataEntries.js';
import { nextTick, watch } from 'vue';
import { watch } from 'vue';
const { allData, emptyEntry, entry } = useDataEntries();
const { showSchlagParts } = useSchlag();
let removeSchlagParts;
watch(entry, (value) => {
if (value && removeSchlagParts) {
if (removeSchlagParts) {
removeSchlagParts();
}
if (!value.schlaginfo?.basic?.parts) {
return;
}
removeSchlagParts = showSchlagParts(value.schlaginfo.basic.parts);
});
function zoomTo(nr) {
entry.value = JSON.parse(JSON.stringify(allData.value.saved[nr]));
nextTick(() => {
removeSchlagParts = showSchlagParts(allData.value.saved[nr].schlaginfo.basic.parts);
});
}
function editEntry(nr) {
Expand Down

0 comments on commit ff69c6b

Please sign in to comment.