|
|
@@ -9,6 +9,7 @@
|
|
|
let location: string;
|
|
|
let selectedWeek: number = 202502;
|
|
|
let duration: number = 15;
|
|
|
+ let renderTimeSelection: boolean = false;
|
|
|
|
|
|
$: console.log(appointmentList);
|
|
|
|
|
|
@@ -29,6 +30,12 @@
|
|
|
|
|
|
function changeWeek() {
|
|
|
console.log("changed");
|
|
|
+ renderTimeSelection = false;
|
|
|
+
|
|
|
+ const index = appointmentList.findIndex((entry) => entry.week === selectedWeek);
|
|
|
+ if (index !== -1 && selectedWeekAppointments !== undefined) {
|
|
|
+ appointmentList[index].appointments = selectedWeekAppointments;
|
|
|
+ }
|
|
|
|
|
|
const ix = appointmentList.findIndex((entry) => entry.week === selectedWeek);
|
|
|
if (ix === -1) {
|
|
|
@@ -46,10 +53,12 @@
|
|
|
}
|
|
|
appointmentList = [... appointmentList, tmp];
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
selectedWeekAppointments = appointmentList.find(
|
|
|
(entry) => entry.week === selectedWeek
|
|
|
)?.appointments;
|
|
|
+ renderTimeSelection = true;
|
|
|
+ //setTimeout(() => renderTimeSelection = false, 2000);
|
|
|
}
|
|
|
|
|
|
let selectedWeekAppointments = appointmentList.find(
|
|
|
@@ -60,6 +69,8 @@
|
|
|
const ix = appointmentList.findIndex((entry) => entry.week === selectedWeek);
|
|
|
if (ix !== -1 && selectedWeekAppointments !== undefined) {
|
|
|
appointmentList[ix].appointments = selectedWeekAppointments;
|
|
|
+ //renderTimeSelection = true;
|
|
|
+ //setTimeout(() => renderTimeSelection = false, 2000);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -72,8 +83,11 @@
|
|
|
<CreatorBaseInputs changeWeek={changeWeek} bind:topic bind:location bind:selectedWeek bind:duration />
|
|
|
|
|
|
{#if selectedWeekAppointments}
|
|
|
- <CreatorTimeInputs bind:weekdays={selectedWeekAppointments} />
|
|
|
+ {#key renderTimeSelection}
|
|
|
+ <CreatorTimeInputs bind:weekdays={selectedWeekAppointments} bind:selectedWeek />
|
|
|
+ {/key}
|
|
|
{/if}
|
|
|
+
|
|
|
</fieldset>
|
|
|
|
|
|
<CreatorInputs bind:creatorInputs />
|