Просмотр исходного кода

fix(demo): runtime server config (#736)

Louis Young 4 месяцев назад
Родитель
Сommit
b2c2cd0525

+ 2 - 1
apps/demo-free-layout/src/plugins/runtime-plugin/create-runtime-plugin.ts

@@ -17,6 +17,7 @@ export const createRuntimePlugin = definePluginCreator<RuntimePluginOptions, Plu
   onBind({ bind, rebind }, options) {
     bind(WorkflowRuntimeClient).toSelf().inSingletonScope();
     bind(WorkflowRuntimeServerClient).toSelf().inSingletonScope();
+    bind(WorkflowRuntimeBrowserClient).toSelf().inSingletonScope();
     if (options.mode === 'server') {
       rebind(WorkflowRuntimeClient).to(WorkflowRuntimeServerClient);
     } else {
@@ -26,7 +27,7 @@ export const createRuntimePlugin = definePluginCreator<RuntimePluginOptions, Plu
   },
   onInit(ctx, options) {
     if (options.mode === 'server') {
-      const serverClient = ctx.get(WorkflowRuntimeServerClient);
+      const serverClient = ctx.get<WorkflowRuntimeServerClient>(WorkflowRuntimeClient);
       serverClient.init(options.serverConfig);
     }
   },