mirror of
https://github.com/dream-num/univer.git
synced 2026-09-24 15:32:18 +08:00
fix: univer plugin holder start immediately
This commit is contained in:
@@ -34,6 +34,7 @@ export class PluginService implements IDisposable {
|
||||
@Inject(Injector) private readonly _injector: Injector
|
||||
) {
|
||||
this._pluginHolderForUniver = this._injector.createInstance(PluginHolder, true);
|
||||
this._pluginHolderForUniver.start();
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
@@ -55,6 +56,7 @@ export class PluginService implements IDisposable {
|
||||
const { type } = plugin;
|
||||
if (type === UniverInstanceType.UNIVER) {
|
||||
this._pluginHolderForUniver.registerPlugin(plugin, config);
|
||||
this._pluginHolderForUniver.flush();
|
||||
} else {
|
||||
// If it's type is for specific document, we should run them at specific time.
|
||||
const holder = this._ensurePluginHolderForType(type);
|
||||
@@ -62,10 +64,6 @@ export class PluginService implements IDisposable {
|
||||
}
|
||||
}
|
||||
|
||||
start(): void {
|
||||
this._pluginHolderForUniver.start();
|
||||
}
|
||||
|
||||
startPluginForType(type: UniverType): void {
|
||||
const holder = this._ensurePluginHolderForType(type);
|
||||
holder.start();
|
||||
|
||||
@@ -70,6 +70,7 @@ export class Univer {
|
||||
logLevel && this._injector.get(ILogService).setLogLevel(logLevel);
|
||||
|
||||
this._init(injector);
|
||||
const _a = this._pluginService;
|
||||
}
|
||||
|
||||
__getInjector(): Injector {
|
||||
@@ -119,8 +120,6 @@ export class Univer {
|
||||
const univerInstanceService = injector.get(IUniverInstanceService) as UniverInstanceService;
|
||||
univerInstanceService.__setCreateHandler(
|
||||
(type: UnitType, data, ctor) => {
|
||||
this._pluginService.start();
|
||||
|
||||
if (!this._startedTypes.has(type)) {
|
||||
this._pluginService.startPluginForType(type);
|
||||
this._startedTypes.add(type);
|
||||
|
||||
Reference in New Issue
Block a user