From e263908bd8b1e7e5a975934000787be22989bf57 Mon Sep 17 00:00:00 2001 From: Chika Date: Thu, 7 Jul 2022 20:44:33 +0300 Subject: [PATCH] stores/statuses: add method resetStatus --- stores/calculation/index.ts | 1 + stores/calculation/statuses/index.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/stores/calculation/index.ts b/stores/calculation/index.ts index 9f461f2..fcc3484 100644 --- a/stores/calculation/index.ts +++ b/stores/calculation/index.ts @@ -22,6 +22,7 @@ export default class CalculationStore { resetElement = (elementName: Elements) => { this.$values.resetElementValue(elementName); this.$options.resetOption(elementName); + this.$status.resetStatus(elementName); this.$validation.clearErrors(elementName); }; } diff --git a/stores/calculation/statuses/index.ts b/stores/calculation/statuses/index.ts index b8f7924..3b75bc0 100644 --- a/stores/calculation/statuses/index.ts +++ b/stores/calculation/statuses/index.ts @@ -30,4 +30,8 @@ export default class StatusStore { setStatuses = (statuses: CalculationStatuses) => { this.statuses = Object.assign(this.statuses, statuses); }; + + resetStatus = (elementName: Elements) => { + this.statuses[elementName] = defaultStatuses[elementName]; + }; }