modal alert if error

pull/5370/head
yann300 4 years ago
parent bb1a2cf9d9
commit d73f06001c
  1. 10
      apps/remix-ide/src/app/ui/landing-page/landing-page.js
  2. 2
      apps/remix-ide/src/lib/gist-handler.js

@ -247,10 +247,14 @@ export class LandingPage extends ViewPlugin {
(loadingMsg) => { tooltip(loadingMsg) }, (loadingMsg) => { tooltip(loadingMsg) },
(error, content, cleanUrl, type, url) => { (error, content, cleanUrl, type, url) => {
if (error) { if (error) {
modalDialogCustom.alert(error) modalDialogCustom.alert(error.message || error)
} else { } else {
fileProviders.browser.addExternal(type + '/' + cleanUrl, content, url) try {
this.verticalIcons.select('fileExplorers') fileProviders.workspace.addExternal(type + '/' + cleanUrl, content, url)
this.verticalIcons.select('fileExplorers')
} catch (e) {
modalDialogCustom.alert(e.message)
}
} }
} }
) )

@ -60,6 +60,8 @@ function GistHandler (_window) {
if (!errorLoadingFile) { if (!errorLoadingFile) {
const provider = fileManager.getProvider('workspace') const provider = fileManager.getProvider('workspace')
provider.lastLoadedGistId = gistId provider.lastLoadedGistId = gistId
} else {
modalDialogCustom.alert(errorLoadingFile.message || errorLoadingFile)
} }
}) })
}) })

Loading…
Cancel
Save