pull/1/head
LianaHus 5 years ago
parent 3178ffa9c4
commit e7fa42bc6d
  1. 43
      src/app/files/fileManager.js

@ -135,28 +135,29 @@ class FileManager extends FileSystemApi {
} }
async setFile (path, content) { async setFile (path, content) {
if (this.currentRequest) { let reject = false
let reject = false let saveAsCopy = false
let saveAsCopy = false
function acceptFileRewriting (e, toaster) {
reject = false
e.target.innerHTML = 'Accepted'
toaster.hide()
toaster.forceResolve()
}
function cancelFileRewriting (e, toaster) {
reject = true
e.target.innerHTML = 'Canceled'
toaster.hide()
}
const saveFileAsCopy = (e, toaster) => {
if (saveAsCopy) return
this._saveAsCopy(path, content)
saveAsCopy = true function acceptFileRewriting (e, toaster) {
e.target.innerHTML = 'Saved' reject = false
toaster.hide() e.target.innerHTML = 'Accepted'
} toaster.hide()
toaster.forceResolve()
}
function cancelFileRewriting (e, toaster) {
reject = true
e.target.innerHTML = 'Canceled'
toaster.hide()
}
const saveFileAsCopy = (e, toaster) => {
if (saveAsCopy) return
this._saveAsCopy(path, content)
saveAsCopy = true
e.target.innerHTML = 'Saved'
toaster.hide()
}
if (this.currentRequest) {
let actions = (toaster) => { let actions = (toaster) => {
return yo` return yo`
<div class="container ml-1"> <div class="container ml-1">

Loading…
Cancel
Save