mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2025-06-11 18:43:22 +02:00
Add delay render support.
This commit is contained in:
@ -32,7 +32,7 @@ class Editor {
|
||||
}
|
||||
|
||||
isMapLoadded(): boolean {
|
||||
return this.component?.getDesigner()?.getMindmap() != null;
|
||||
return this.component.isLoaded();
|
||||
}
|
||||
|
||||
save(minor: boolean): void {
|
||||
@ -57,9 +57,9 @@ class Editor {
|
||||
mapId: string,
|
||||
persistenceManager: PersistenceManager,
|
||||
widgetManager: WidgetManager,
|
||||
): void {
|
||||
): Promise<void> {
|
||||
this.component.buildDesigner(persistenceManager, widgetManager);
|
||||
this.component.loadMap(mapId);
|
||||
return this.component.loadMap(mapId);
|
||||
}
|
||||
|
||||
registerEvents(canvasUpdate: (timestamp: number) => void, capability: Capability): void {
|
||||
|
@ -79,10 +79,12 @@ const Editor = ({
|
||||
const capability = new Capability(options.mode, mapInfo.isLocked());
|
||||
|
||||
const mindplotRef = useCallback((component: MindplotWebComponent) => {
|
||||
// Initialized model ...
|
||||
const model = new Model(component);
|
||||
model.loadMindmap(mapInfo.getId(), persistenceManager, widgetManager);
|
||||
model.registerEvents(setCanvasUpdate, capability);
|
||||
|
||||
// Force refresh after map load ...
|
||||
model.loadMindmap(mapInfo.getId(), persistenceManager, widgetManager).then(() => {
|
||||
setCanvasUpdate(Date.now());
|
||||
});
|
||||
setModel(model);
|
||||
}, []);
|
||||
|
||||
@ -137,7 +139,7 @@ const Editor = ({
|
||||
message={mapInfo.isLocked() ? mapInfo.getLockedMessage() : ''}
|
||||
/>
|
||||
|
||||
{!model && (
|
||||
{!model?.isMapLoadded() && (
|
||||
<SpinnerCentered>
|
||||
<Vortex
|
||||
visible={true}
|
||||
|
Reference in New Issue
Block a user