mirror of
https://github.com/dream-num/univer.git
synced 2026-09-24 15:32:18 +08:00
fix: univer should auto start
This commit is contained in:
@@ -62,9 +62,7 @@ univer.registerPlugin(UniverUIPlugin, {
|
||||
|
||||
univer.registerPlugin(UniverDocsUIPlugin);
|
||||
|
||||
univer.registerPlugin(UniverSheetsPlugin, {
|
||||
notExecuteFormula: true,
|
||||
});
|
||||
univer.registerPlugin(UniverSheetsPlugin);
|
||||
univer.registerPlugin(UniverSheetsUIPlugin);
|
||||
|
||||
// sheet feature plugins
|
||||
@@ -73,7 +71,7 @@ univer.registerPlugin(UniverSheetsNumfmtPlugin);
|
||||
univer.registerPlugin(DebuggerPlugin);
|
||||
univer.registerPlugin(UniverSheetsZenEditorPlugin);
|
||||
univer.registerPlugin(UniverFormulaEnginePlugin, {
|
||||
notExecuteFormula: true,
|
||||
notExecuteFormula: false,
|
||||
});
|
||||
univer.registerPlugin(UniverSheetsFormulaPlugin);
|
||||
univer.registerPlugin(UniverRPCMainThreadPlugin, {
|
||||
|
||||
@@ -21,7 +21,7 @@ import { type UnitType, UniverInstanceType } from '../../common/unit';
|
||||
import { PluginHolder } from './plugin-holder';
|
||||
import type { Plugin, PluginCtor } from './plugin';
|
||||
|
||||
const INIT_LAZY_PLUGINS_TIMEOUT = 200;
|
||||
const INIT_LAZY_PLUGINS_TIMEOUT = 4;
|
||||
|
||||
/**
|
||||
* This service manages plugin registration.
|
||||
@@ -50,9 +50,7 @@ export class PluginService implements IDisposable {
|
||||
registerPlugin<T extends PluginCtor<Plugin>>(plugin: T, config?: ConstructorParameters<T>[0]): void {
|
||||
this._assertPluginValid(plugin);
|
||||
|
||||
if (this._pluginHolderForUniver.started) {
|
||||
this._scheduleInitPluginAfterStarted();
|
||||
}
|
||||
this._scheduleInitPlugin();
|
||||
|
||||
const { type } = plugin;
|
||||
if (type === UniverInstanceType.UNIVER) {
|
||||
@@ -96,7 +94,7 @@ export class PluginService implements IDisposable {
|
||||
}
|
||||
|
||||
private _initLazyPluginsTimer?: number;
|
||||
private _scheduleInitPluginAfterStarted() {
|
||||
private _scheduleInitPlugin() {
|
||||
if (this._initLazyPluginsTimer === undefined) {
|
||||
this._initLazyPluginsTimer = setTimeout(
|
||||
() => {
|
||||
|
||||
@@ -111,10 +111,6 @@ export class Univer {
|
||||
return this._univerInstanceService.createUnit<ISlideData, SlideDataModel>(UniverInstanceType.SLIDE, data);
|
||||
}
|
||||
|
||||
start(): void {
|
||||
this._tryProgressToStart();
|
||||
}
|
||||
|
||||
private _init(injector: Injector): void {
|
||||
this._univerInstanceService.registerCtorForType(UniverInstanceType.SHEET, Workbook);
|
||||
this._univerInstanceService.registerCtorForType(UniverInstanceType.DOC, DocumentDataModel);
|
||||
|
||||
@@ -90,7 +90,6 @@ export class UniverFormulaEnginePlugin extends Plugin {
|
||||
[IActiveDirtyManagerService, { useClass: ActiveDirtyManagerService }],
|
||||
[ISuperTableService, { useClass: SuperTableService }],
|
||||
|
||||
|
||||
// Models
|
||||
[FormulaDataModel],
|
||||
|
||||
@@ -147,8 +146,4 @@ export class UniverFormulaEnginePlugin extends Plugin {
|
||||
|
||||
dependencies.forEach((dependency) => this._injector.add(dependency));
|
||||
}
|
||||
|
||||
override onReady(): void {
|
||||
this._injector.get(FormulaDataModel).initFormulaData();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user