From e81614b986cd09ee94ef9e625b2ea137a5479b59 Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 24 Mar 2021 10:18:54 +0100 Subject: [PATCH] added modal to ask for download` --- .../src/app/ui/landing-page/landing-page.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide/src/app/ui/landing-page/landing-page.js b/apps/remix-ide/src/app/ui/landing-page/landing-page.js index 10922d988f..35bee2dd60 100644 --- a/apps/remix-ide/src/app/ui/landing-page/landing-page.js +++ b/apps/remix-ide/src/app/ui/landing-page/landing-page.js @@ -7,6 +7,7 @@ const csjs = require('csjs-inject') const globalRegistry = require('../../../global/registry') const CompilerImport = require('../../compiler/compiler-imports') const modalDialogCustom = require('../modal-dialog-custom') +const modalDialog = require('../modaldialog') const tooltip = require('../tooltip') const GistHandler = require('../../../lib/gist-handler') const QueryParams = require('../../../lib/query-params.js') @@ -315,8 +316,7 @@ export class LandingPage extends ViewPlugin { node.dispatchEvent(new MouseEvent('click')) } catch (e) { var evt = document.createEvent('MouseEvents') - evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80, - 20, false, false, false, false, 0, null) + evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null) node.dispatchEvent(evt) } }, 0) // 40s @@ -387,6 +387,18 @@ export class LandingPage extends ViewPlugin { } const migrateWorkspace = async () => { + modalDialog( + 'File system Migration', + yo`'Do you want to save your files first?'`, + { + label: 'Yes', + fn: async () => { await downloadFiles() } + }, + { + label: 'No', + fn: () => {} + } + ) tooltip('migrating workspace...') try { const workspaceName = await migrateToWorkspace(this.fileManager, this.filePanel) @@ -474,7 +486,7 @@ export class LandingPage extends ViewPlugin { ${this.websiteIcon} Featuring website

-

+

switchToPreviousVersion()}>Old experience