fix issue with storage

This commit is contained in:
jfh
2020-09-09 01:35:47 +02:00
parent ff71d836f8
commit 029ed1a1e1
76 changed files with 780 additions and 948 deletions

View File

@@ -165,10 +165,10 @@ export default {
let loaded = false;
return {
name: 'storage',
async langReady ({importLocale}) {
async langReady ({lang}) {
const storagePrompt = new URL(top.location).searchParams.get('storagePrompt');
const confirmSetStorage = await importLocale();
// eslint-disable-next-line node/no-unsupported-features/es-syntax
const {default: confirmSetStorage} = await import(`./locale/${lang}.js`);
const {
message, storagePrefsAndContent, storagePrefsOnly,
storagePrefs, storageNoPrefsOrContent, storageNoPrefs,

View File

@@ -18,8 +18,8 @@ For default config and extensions (and available options) available to
`setConfig()`, see the file `docs/tutorials/ConfigOptions.md`
*/
import 'core-js/stable/index.js';
import 'regenerator-runtime/runtime.js';
// import 'core-js/stable/index.js';
// import 'regenerator-runtime/runtime.js';
import svgEditor from './svgedit.js';
// URL OVERRIDE CONFIG

View File

@@ -2834,13 +2834,19 @@ editor.init = function () {
* @listens module:svgcanvas.SvgCanvas#event:extension_added
* @returns {Promise<void>|void} Resolves to `undefined`
*/
const extAdded = function (win, ext) {
const extAdded = async (win, ext) => {
if (!ext) {
return undefined;
}
let cbCalled = false;
let resizeDone = false;
if (ext.langReady) {
if (editor.langChanged) { // We check for this since the "lang" pref could have been set by storage
const lang = editor.pref('lang');
await ext.langReady({lang});
}
}
/**
* Clear resize timer if present and if not previously performed,
* perform an icon resize.