WIP Наладила таймер

This commit is contained in:
Daria Golova
2022-12-02 15:15:56 +03:00
parent 469961a05b
commit 1db2ca2113
3 changed files with 15 additions and 8 deletions

View File

@@ -93,8 +93,10 @@ export default {
}, },
methods: { methods: {
updateDataClient() { updateDataClient() {
if (this.dataClients.find(({ id }) => id === this.deletedRowId)) {
if (this.dataClients.length === 1) this.currentTablePage -= 1; if (this.dataClients.length === 1) this.currentTablePage -= 1;
else this.fetchDataClients(); else this.fetchDataClients();
}
}, },
saveDataClients(data) { saveDataClients(data) {
this.dataClients = data.results; this.dataClients = data.results;

View File

@@ -189,8 +189,10 @@ export default {
}, },
changeCountdown() { changeCountdown() {
if (this.countdown === 0) { if (this.countdown === 0) {
this.deleteClient().then(() => {
this.updateDataClient();
this.stopTimer(); this.stopTimer();
this.deleteClient().then(() => this.updateDataClient()); });
} else { } else {
this.countdown -= 1; this.countdown -= 1;
} }
@@ -483,9 +485,12 @@ export default {
photo: this.client.photo, photo: this.client.photo,
}; };
}, },
/*beforeUnmount() { beforeUnmount() {
if (this.timer) {
this.deleteClient().then(() => this.updateDataClient());
this.stopTimer(); this.stopTimer();
},*/ }
},
}; };
</script> </script>