Skip to content

Commit

Permalink
Fix error that deleted units
Browse files Browse the repository at this point in the history
  • Loading branch information
joswarmer committed Nov 19, 2024
1 parent f7a76d9 commit aded5c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/webapp-lib/src/lib/language/EditorState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ export class EditorState {
if (!!unit) {
if (!!this.currentModel?.name && this.currentModel?.name?.length) {
if (!!unit.name && unit.name.length > 0) {
if (get(currentUnitName).id === unit.freId()) {
// Saved unit already exists but its nbane has changed.
LOGGER.log("Saving unit that changed name, do a rename")
if (get(currentUnitName).id === unit.freId() && get(currentUnitName).name !== unit.name) {
// Saved unit already exists but its name has changed.
LOGGER.log(`Saving unit that changed name, do a rename from ${get(currentUnitName).name} to ${unit.name}`)
await this.renameModelUnit(unit, get(currentUnitName).name, unit.name)
} else {
await this.modelStore.saveUnit(unit);
Expand Down

0 comments on commit aded5c9

Please sign in to comment.