From 75d60246ac204bb3bbe081735a0dd3ccf205f83c Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Tue, 4 Apr 2023 15:08:51 +0300 Subject: [PATCH] process/load-kp: fix create-kp triggered load-kp --- apps/web/process/load-kp/reactions.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/web/process/load-kp/reactions.ts b/apps/web/process/load-kp/reactions.ts index 56519d7..1e4805a 100644 --- a/apps/web/process/load-kp/reactions.ts +++ b/apps/web/process/load-kp/reactions.ts @@ -9,8 +9,10 @@ export function common({ store, trpcClient }: ProcessContext) { const { $calculation, $process, $tables } = store; reaction( - () => $calculation.element('selectQuote').getOption(), - (quote) => { + () => $calculation.$values.getValue('quote'), + () => { + const quote = $calculation.element('selectQuote').getOption(); + if (!quote || $process.has('LoadKP')) return; $process.add('LoadKP');