From 344bee47aea530d81aee20c9aa5460948eda7483 Mon Sep 17 00:00:00 2001 From: YuHong Date: Thu, 10 Oct 2024 18:26:45 +0800 Subject: [PATCH] chore: replay-only will not register other dependency --- packages-experimental/action-recorder/src/plugin.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages-experimental/action-recorder/src/plugin.ts b/packages-experimental/action-recorder/src/plugin.ts index f69f570eb51..8618e305fe0 100644 --- a/packages-experimental/action-recorder/src/plugin.ts +++ b/packages-experimental/action-recorder/src/plugin.ts @@ -45,11 +45,14 @@ export class UniverActionRecorderPlugin extends Plugin { } override onStarting(): void { - ([ - [ActionRecorderService], - [ActionReplayService], - [ActionRecorderController], - ] as Dependency[]).forEach((d) => this._injector.add(d)); + const dependency = this._config.replayOnly + ? [[ActionReplayService]] + : [ + [ActionRecorderService], + [ActionReplayService], + [ActionRecorderController], + ]; + (dependency as Dependency[]).forEach((d) => this._injector.add(d)); } override onSteady(): void {