From 8642d3b49dd5b53f496d8cca3506ad3593e2084e Mon Sep 17 00:00:00 2001 From: Antamansid Date: Thu, 17 Oct 2024 16:28:35 +0300 Subject: [PATCH] fix(selection): stop emit unselect event if select field not specified --- src/store/block/BlocksList.ts | 2 +- src/store/connection/ConnectionList.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/store/block/BlocksList.ts b/src/store/block/BlocksList.ts index e8ccce8..b864b9a 100644 --- a/src/store/block/BlocksList.ts +++ b/src/store/block/BlocksList.ts @@ -158,7 +158,7 @@ export class BlockListStore { if (!blockState) { return; } - if (selected !== blockState.selected) { + if (selected !== Boolean(blockState.selected)) { if (!params?.ignoreChanges) { blockState.updateBlock({ selected }); } diff --git a/src/store/connection/ConnectionList.ts b/src/store/connection/ConnectionList.ts index de32ed5..6811a47 100644 --- a/src/store/connection/ConnectionList.ts +++ b/src/store/connection/ConnectionList.ts @@ -41,7 +41,7 @@ export class ConnectionsStore { ) { const state = connection instanceof ConnectionState ? connection : this.$connectionsMap.value.get(connection); if (state) { - if (selected !== state.$state.value.selected) { + if (selected !== Boolean(state.$state.value.selected)) { if (!params?.ignoreChange) { state.updateConnection({ selected,