comments / notifications : improve abstraction

This commit is contained in:
isUnknown 2024-11-18 12:00:19 +01:00
parent f467012241
commit 32c026acfe
11 changed files with 92 additions and 65 deletions

View file

@ -5,12 +5,7 @@
<DialogWrapper v-if="dialog.content" />
<div class="kanban">
<ProjectStep
v-for="step in page.steps"
:key="step"
:step="step"
@update:dialog="updateDialog"
>
<ProjectStep v-for="step in page.steps" :key="step" :step="step">
</ProjectStep>
</div>
</main>
@ -37,10 +32,10 @@ if (route.query.dialog) {
watch(
() => route.query.dialog,
(targetStepId) => {
if (targetStepId) {
(targetStepSlug) => {
if (targetStepSlug) {
const targetStep = page.value.steps.find(
(step) => step.id === targetStepId
(step) => step.slug === targetStepSlug
);
dialog.content = targetStep;
} else {
@ -49,8 +44,10 @@ watch(
}
);
function openDialog(stepId) {
const targetStep = page.value.steps.find((step) => step.id === stepId);
function openDialog(targetStepSlug) {
const targetStep = page.value.steps.find(
(step) => step.slug === targetStepSlug
);
dialog.content = targetStep;
}
</script>