-
Notifications
You must be signed in to change notification settings - Fork 98
#9186 Clean-up for fix: camera becomes perspective fix cleanup #9469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#9186 Clean-up for fix: camera becomes perspective fix cleanup #9469
Conversation
…ermine if file watcher event was caused by us or externally
…he writeFile call
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| // which would be evident if we already have matching code there. | ||
| if (!isCodeTheSame(code, kclManager.codeSignal.value)) { | ||
| const lastWrittenCode = kclManager.lastWrite?.code | ||
| if (!lastWrittenCode || !isCodeTheSame(lastWrittenCode, code)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the actual fix instead of using stat.mtimeMs
|
|
||
| toast('Reloading file from disk') | ||
| // If we can use emojis this looks nice: | ||
| // toast('Reloading file from disk', { icon: '📁' }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks nice I just didn't want to start adding emojis to the codebase since we don't have any yet.
| code: this.code ?? '', | ||
| time: Date.now(), | ||
| } | ||
| this.writeCausedByAppCheckedInFileTreeFileSystemWatcher = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved this down right before the actual write as I think that's technically the more correct way to do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it out on sketch-solve and it seemed fine. Thanks for doing this!
This is an alternative fix for #9186.
The previous fix used the current file's last modified date and compared it to when ZDS last updated the file to determine if changes on the file were caused by us or externally.
This alternative fix fixes the original issue by comparing the last written code to the file's content, instead of the current
kclManager.codewhich was the main cause for the original bug.There are 2 additional refinements: