* Revert "Deflake project settings override on desktop (#4370)"
This reverts commit ad1cd56891
.
* Part of the revert
This commit is contained in:
@ -121,28 +121,20 @@ export default class CodeManager {
|
||||
// Only write our buffer contents to file once per second. Any faster
|
||||
// and file-system watchers which read, will receive empty data during
|
||||
// writes.
|
||||
|
||||
clearTimeout(this.timeoutWriter)
|
||||
this.writeCausedByAppCheckedInFileTreeFileSystemWatcher = true
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
this.timeoutWriter = setTimeout(() => {
|
||||
if (!this._currentFilePath)
|
||||
return reject(new Error('currentFilePath not set'))
|
||||
|
||||
// Wait one event loop to give a chance for params to be set
|
||||
// Save the file to disk
|
||||
this.timeoutWriter = setTimeout(() => {
|
||||
// Wait one event loop to give a chance for params to be set
|
||||
// Save the file to disk
|
||||
this._currentFilePath &&
|
||||
window.electron
|
||||
.writeFile(this._currentFilePath, this.code ?? '')
|
||||
.then(resolve)
|
||||
.catch((err: Error) => {
|
||||
// TODO: add tracing per GH issue #254 (https://github.com/KittyCAD/modeling-app/issues/254)
|
||||
console.error('error saving file', err)
|
||||
toast.error('Error saving file, please check file permissions')
|
||||
reject(err)
|
||||
})
|
||||
}, 1000)
|
||||
})
|
||||
}, 1000)
|
||||
} else {
|
||||
safeLSSetItem(PERSIST_CODE_KEY, this.code)
|
||||
}
|
||||
|
Reference in New Issue
Block a user