Skip to content

Commit

Permalink
closes #51
Browse files Browse the repository at this point in the history
  • Loading branch information
OlliL committed May 7, 2024
1 parent 1228572 commit 40f2131
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/views/etf/ListEtfDepot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -498,17 +498,14 @@ const loadEtfs = (etfId?: number) => {
}
etfsLoaded.value = true;
if (selectedEtf.value !== undefined) {
loadData(selectedEtf.value);
}
})
.catch((backendError) => {
handleBackendError(backendError, serverErrors);
});
};
const loadData = (etfId: number) => {
console.log("loadData");
serverErrors.value = new Array<string>();
dataLoaded.value = false;
calcResults.value = {} as EtfSalesCalculation;
Expand Down Expand Up @@ -650,11 +647,16 @@ const etfFlowUpdated = (etfFlow: EtfFlow) => {
loadData(etfFlow.etfId);
};
watch(selectedEtf, (newVal, oldVal) => {
if (oldVal != selectedEtf.value && newVal !== undefined) {
loadData(newVal);
}
});
watch(
selectedEtf,
(newVal, oldVal) => {
if (oldVal != selectedEtf.value && newVal !== undefined) {
console.log("watch", oldVal, selectedEtf.value, newVal);
loadData(newVal);
}
},
{ immediate: true },
);
const routerPush = () => {
if ((selectedEtf.value || "") != (props.etfId || "")) {
Expand Down

0 comments on commit 40f2131

Please sign in to comment.