From b2c297a7fd8e07c2da9e2d2c773f73e803d489f2 Mon Sep 17 00:00:00 2001 From: Sipachev Igor Date: Tue, 22 Mar 2022 18:24:21 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BB=20=D0=BB=D0=B8?= =?UTF-8?q?=D1=88=D0=BD=D0=B8=D0=B5=20=D0=B7=D0=B0=D0=BF=D1=80=D0=BE=D1=81?= =?UTF-8?q?=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- popup/src/components/mocks-tab/template.html | 2 +- popup/src/components/mocks/script.ts | 14 ++++++++++---- popup/src/components/person-tab/template.html | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/popup/src/components/mocks-tab/template.html b/popup/src/components/mocks-tab/template.html index 4e146f8..6bf7063 100644 --- a/popup/src/components/mocks-tab/template.html +++ b/popup/src/components/mocks-tab/template.html @@ -5,6 +5,6 @@

- +
diff --git a/popup/src/components/mocks/script.ts b/popup/src/components/mocks/script.ts index 4cfbe41..d09fe2d 100644 --- a/popup/src/components/mocks/script.ts +++ b/popup/src/components/mocks/script.ts @@ -16,7 +16,9 @@ export default class Mocks extends Vue { @Prop() personalCode!: string - mode: Mode = Mode.ADD + @Prop() + mode!: Mode + registers = new Registers() register2Id: Record = {} @@ -26,20 +28,21 @@ export default class Mocks extends Vue { @Watch('personalCode', { immediate: true }) onPersonalCodeChanged (value: string, oldValue: string) { - this.mode = Mode.ADD - httpClient.mockConfigurations({ personalCode: this.personalCode }) + this.mode === Mode.UPDATE && httpClient.mockConfigurations({ personalCode: this.personalCode }) .then((data: any) => { for (const mockConfiguration of data.data) { // eslint-disable-next-line @typescript-eslint/ban-ts-ignore // @ts-ignore this.registers[mockConfiguration.code] = mockConfiguration.value this.register2Id[mockConfiguration.code] = mockConfiguration.id - this.mode = Mode.UPDATE } }) } onXteeMtaChanged () { + if (this.mode !== Mode.UPDATE) { + return + } if (this.register2Id.xtee_mta === 'undefined') { return } @@ -54,6 +57,9 @@ export default class Mocks extends Vue { } onRiaChanged () { + if (this.mode !== Mode.UPDATE) { + return + } if (this.register2Id.ria === 'undefined') { return } diff --git a/popup/src/components/person-tab/template.html b/popup/src/components/person-tab/template.html index 0bac3e4..917895f 100644 --- a/popup/src/components/person-tab/template.html +++ b/popup/src/components/person-tab/template.html @@ -60,6 +60,6 @@
Memory: {{copyText}}

- +