From 089da33b353ccede087db8fabb4974da8e12661d Mon Sep 17 00:00:00 2001 From: Aleksei Potsetsuev Date: Wed, 27 Nov 2024 15:01:29 +0800 Subject: [PATCH] fix: fist subscription execution --- packages/@wroud/flow-middleware/src/MiddlewareRequest.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/@wroud/flow-middleware/src/MiddlewareRequest.ts b/packages/@wroud/flow-middleware/src/MiddlewareRequest.ts index 73c5704..6620e21 100644 --- a/packages/@wroud/flow-middleware/src/MiddlewareRequest.ts +++ b/packages/@wroud/flow-middleware/src/MiddlewareRequest.ts @@ -213,7 +213,10 @@ async function subscribe( ): Promise { const existingSubscription = state.get(key); - if (areDependenciesEqual(existingSubscription?.dependencies, dependencies)) { + if ( + existingSubscription && + areDependenciesEqual(existingSubscription.dependencies, dependencies) + ) { return; }