From c687a775eb8efdb792c495bec72e7e547b82c068 Mon Sep 17 00:00:00 2001 From: Faton Ramadani Date: Fri, 19 May 2023 21:02:34 +0200 Subject: [PATCH] fix(frontend): Fix rx (#1609) * fix(frontend): Fix inputValue connection to ensure done event is always sent * fix(frontend): Fix RX --- frontend/src/lib/components/apps/rx.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/apps/rx.ts b/frontend/src/lib/components/apps/rx.ts index 0f852aeac2b7..2d72ab59912a 100644 --- a/frontend/src/lib/components/apps/rx.ts +++ b/frontend/src/lib/components/apps/rx.ts @@ -167,7 +167,13 @@ export function settableOutput(state: Writable, previousValue: T): Ou function set(x: T, force: boolean = false) { if (!deepEqual(value, x) || force) { state.update((x) => x + 1) - value = x + + if (typeof x === 'object') { + value = JSON.parse(JSON.stringify(x)) + } else { + value = x + } + subscribers.forEach((x) => x.next(value!)) } }