Skip to content

Commit

Permalink
Merge pull request #357 from MOV-AI/FP-2770-scene-closing-button-not-…
Browse files Browse the repository at this point in the history
…working-when-with-changes

- FP-2770: Scene closing button not working when with changes *
  • Loading branch information
diasdm authored Oct 18, 2024
2 parents 7edd37d + 4854773 commit 8838d61
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# TBD

- [FP-2770](https://movai.atlassian.net/browse/FP-2770): Scene closing button not working when with changes *

# 1.3.0 - This version contains breaking changes in the lib-ide <-> IDE DataTypes and useDataTypes interface

- [FP-2716](https://movai.atlassian.net/browse/FP-2716): Annotations imported cannot be edited
Expand Down
5 changes: 4 additions & 1 deletion src/plugins/DocManager/DocManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,10 @@ class DocManager extends IDEPlugin {
return this.call(PLUGINS.DIALOG.NAME, PLUGINS.DIALOG.CALL.NEW_DOC, {
scope,
placeholder: name,
onSubmit: newName => this.doSave(modelKey, callback, newName, opts),
onSubmit: newName => {
this.doSave(modelKey, callback, newName, opts);
this.discardDocChanges({ scope, name: newName });
},
onClose: () => this.saveStack.delete(`${name}_${scope}`)
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/views/Tabs/hooks/useTabLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ const useTabLayout = (props, dockRef) => {
*/
const _onLayoutRemoveTab = useCallback(
(newLayout, tabId, forceClose) => {
const { name, scope, isNew, isDirty } = tabsByIdRef.current.get(tabId);
const { name, scope, isNew, isDirty } = tabsByIdRef.current?.get(tabId) ?? {};

if (isDirty && !forceClose) {
const document = { id: tabId, name, scope, isNew };
Expand Down

0 comments on commit 8838d61

Please sign in to comment.