Make application aware it saved the buffer and not something else (#4314)

Make application aware it saved the buffer and something else
This commit is contained in:
49fl
2024-10-25 18:07:50 -04:00
committed by GitHub
parent 9772869545
commit 4925251c29
2 changed files with 10 additions and 0 deletions

View File

@ -20,6 +20,8 @@ export default class CodeManager {
private _hotkeys: { [key: string]: () => void } = {}
private timeoutWriter: ReturnType<typeof setTimeout> | undefined = undefined
public writeCausedByAppCheckedInFileTreeFileSystemWatcher = false
constructor() {
if (isDesktop()) {
this.code = ''
@ -120,6 +122,7 @@ export default class CodeManager {
// and file-system watchers which read, will receive empty data during
// writes.
clearTimeout(this.timeoutWriter)
this.writeCausedByAppCheckedInFileTreeFileSystemWatcher = true
this.timeoutWriter = setTimeout(() => {
// Wait one event loop to give a chance for params to be set
// Save the file to disk