From bb1ebac5e2e868e50576777a9f5dbcab1e249588 Mon Sep 17 00:00:00 2001 From: oceanlvr <657531018@qq.com> Date: Wed, 24 Nov 2021 22:54:16 +0800 Subject: [PATCH] fix(subscribe): multi subscribes insert issue --- src/components/SubscriptionsList.vue | 4 +++- src/database/services/ConnectionService.ts | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/SubscriptionsList.vue b/src/components/SubscriptionsList.vue index 2a8e30edf..6742405d3 100644 --- a/src/components/SubscriptionsList.vue +++ b/src/components/SubscriptionsList.vue @@ -371,13 +371,15 @@ export default class SubscriptionsList extends Vue { if (existTopicIndex !== -1) { this.subsList[existTopicIndex].qos = qos } else { - let { topic: unuseTopic, color, alias, ...others } = this.subRecord + let { topic: unuseTopic, color, alias, id, ...others } = this.subRecord alias = aliasArr ? aliasArr[index] : alias if (index > 0) { color = getRandomColor() + id = getSubscriptionId() } this.subsList.push({ topic, + id, color, alias, ...others, diff --git a/src/database/services/ConnectionService.ts b/src/database/services/ConnectionService.ts index a106d47a9..5cdca5c41 100644 --- a/src/database/services/ConnectionService.ts +++ b/src/database/services/ConnectionService.ts @@ -227,7 +227,6 @@ export default class ConnectionService { res.subscriptions = (await this.subscriptionRepository.save( shouldUpdate.map((sub) => { return { - id, ...sub, connectionId: undefined, } as SubscriptionEntity