onlook
onlook copied to clipboard
fix: add prompt to save changes when closing an edited file
Description
Related Issues
Closes: #2070
Type of Change
- [x] Bug fix
- [ ] New feature
- [ ] Documentation update
- [ ] Release
- [ ] Refactor
- [ ] Other (please describe):
Testing
Screenshots (if applicable)
Additional Notes
[!IMPORTANT] Adds prompt to save or discard changes when closing an edited file, with state management and function updates in
index.tsxandIDEManager.
- Behavior:
- Adds prompt to save or discard changes when closing an edited file in
index.tsx.- Handles unsaved changes when closing all files.
- State Management:
- Introduces
showUnsavedDialogandpendingCloseAllstate variables inindex.tsx.- Functions:
- Adds
discardChanges()inindex.tsxto discard unsaved changes.- Updates
closeFile()andcloseAllFiles()inindex.tsxto handle unsaved changes.- Adds
discardFileChanges()inIDEManagerinindex.tsto reset file content and dirty state.This description was created by
for 45cb182b2dc3b081e54c0d7c3d4a25e44c952b80. You can customize this summary. It will automatically update as commits are pushed.