From e7355bc2feff32a11ec1dd3c3286eb70bc58c07c Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Fri, 9 Feb 2024 00:03:34 -0800 Subject: [PATCH] Fix map load. --- packages/editor/src/hooks/useEditor/index.ts | 27 ++++++++++++++----- .../src/hooks/useWidgetManager/index.ts | 17 ++++++++++++ packages/webapp/public/index.html | 2 +- packages/webapp/src/classes/client/index.ts | 2 +- .../src/classes/client/mock-client/index.ts | 2 +- .../src/components/editor-page/index.tsx | 11 ++++++-- 6 files changed, 50 insertions(+), 11 deletions(-) diff --git a/packages/editor/src/hooks/useEditor/index.ts b/packages/editor/src/hooks/useEditor/index.ts index 3cb7beab..0d661280 100644 --- a/packages/editor/src/hooks/useEditor/index.ts +++ b/packages/editor/src/hooks/useEditor/index.ts @@ -1,3 +1,20 @@ +/* + * Copyright [2021] [wisemapping] + * + * Licensed under WiseMapping Public License, Version 1.0 (the "License"). + * It is basically the Apache License, Version 2.0 (the "License") plus the + * "powered by wisemapping" text requirement on every single page; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the license at + * + * http://www.wisemapping.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import { DesignerKeyboard, EditorRenderMode, PersistenceManager } from '@wisemapping/mindplot'; import { useState, useRef, useEffect } from 'react'; import Capability from '../../classes/action/capability'; @@ -65,12 +82,10 @@ export const useEditor = ({ }, [mindplotRef, options]); useEffect(() => { - if (options) { - if (options.enableKeyboardEvents) { - DesignerKeyboard.resume(); - } else { - DesignerKeyboard.pause(); - } + if (options && options.enableKeyboardEvents) { + DesignerKeyboard.resume(); + } else { + DesignerKeyboard.pause(); } }, [options, options?.enableKeyboardEvents]); diff --git a/packages/editor/src/hooks/useWidgetManager/index.ts b/packages/editor/src/hooks/useWidgetManager/index.ts index 011954ff..0ce85c35 100644 --- a/packages/editor/src/hooks/useWidgetManager/index.ts +++ b/packages/editor/src/hooks/useWidgetManager/index.ts @@ -1,3 +1,20 @@ +/* + * Copyright [2021] [wisemapping] + * + * Licensed under WiseMapping Public License, Version 1.0 (the "License"). + * It is basically the Apache License, Version 2.0 (the "License") plus the + * "powered by wisemapping" text requirement on every single page; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the license at + * + * http://www.wisemapping.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import DefaultWidgetManager from '../../classes/default-widget-manager'; export const useWidgetManager = (): { diff --git a/packages/webapp/public/index.html b/packages/webapp/public/index.html index b346c02d..1275c45f 100644 --- a/packages/webapp/public/index.html +++ b/packages/webapp/public/index.html @@ -46,7 +46,7 @@ manifest.json provides metadata used when your web app is installed on a user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ --> - +