diff --git a/src/app/files/fileManager.js b/src/app/files/fileManager.js index bbbd9e8490..04ad12e980 100644 --- a/src/app/files/fileManager.js +++ b/src/app/files/fileManager.js @@ -135,28 +135,29 @@ class FileManager extends FileSystemApi { } async setFile (path, content) { - if (this.currentRequest) { - let reject = 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) + let reject = false + let saveAsCopy = false - saveAsCopy = true - e.target.innerHTML = 'Saved' - toaster.hide() - } + 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 + e.target.innerHTML = 'Saved' + toaster.hide() + } + if (this.currentRequest) { let actions = (toaster) => { return yo`