WIP Наладила таймер
This commit is contained in:
@@ -93,8 +93,10 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
updateDataClient() {
|
||||
if (this.dataClients.length === 1) this.currentTablePage -= 1;
|
||||
else this.fetchDataClients();
|
||||
if (this.dataClients.find(({ id }) => id === this.deletedRowId)) {
|
||||
if (this.dataClients.length === 1) this.currentTablePage -= 1;
|
||||
else this.fetchDataClients();
|
||||
}
|
||||
},
|
||||
saveDataClients(data) {
|
||||
this.dataClients = data.results;
|
||||
|
||||
@@ -189,8 +189,10 @@ export default {
|
||||
},
|
||||
changeCountdown() {
|
||||
if (this.countdown === 0) {
|
||||
this.stopTimer();
|
||||
this.deleteClient().then(() => this.updateDataClient());
|
||||
this.deleteClient().then(() => {
|
||||
this.updateDataClient();
|
||||
this.stopTimer();
|
||||
});
|
||||
} else {
|
||||
this.countdown -= 1;
|
||||
}
|
||||
@@ -483,9 +485,12 @@ export default {
|
||||
photo: this.client.photo,
|
||||
};
|
||||
},
|
||||
/*beforeUnmount() {
|
||||
this.stopTimer();
|
||||
},*/
|
||||
beforeUnmount() {
|
||||
if (this.timer) {
|
||||
this.deleteClient().then(() => this.updateDataClient());
|
||||
this.stopTimer();
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user