From 25e38c0106bbf8d85e8070eabba64b231fef9642 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 22 Sep 2023 10:29:58 +0200 Subject: [PATCH] add an await when setting state --- code/lib/manager-api/src/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/lib/manager-api/src/index.tsx b/code/lib/manager-api/src/index.tsx index bb7fe0e5ec6c..3b0a21bdcb94 100644 --- a/code/lib/manager-api/src/index.tsx +++ b/code/lib/manager-api/src/index.tsx @@ -411,8 +411,8 @@ export function useSharedState(stateId: string, defaultState?: S) { } }); - const setState = (s: S | API_StateMerger, options?: Options) => { - const result = api.setAddonState(stateId, s, options); + const setState = async (s: S | API_StateMerger, options?: Options) => { + const result = await api.setAddonState(stateId, s, options); STORYBOOK_ADDON_STATE[stateId] = result; return result; };