Skip to content

Commit

Permalink
switch to hasChanges, fix bad condition check AGAIN!!
Browse files Browse the repository at this point in the history
  • Loading branch information
nick4598 committed Jan 10, 2025
1 parent f026eaf commit a5c2c76
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
14 changes: 7 additions & 7 deletions packages/transformer/src/IModelExporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1177,14 +1177,14 @@ export class ChangedInstanceIds {
return this._hasCustomRelationshipChanges;
}

public get isEmpty(): boolean {
public get hasChanges(): boolean {
return (
this.codeSpec.isEmpty &&
this.model.isEmpty &&
this.element.isEmpty &&
this.aspect.isEmpty &&
this.relationship.isEmpty &&
this.font.isEmpty
!this.codeSpec.isEmpty ||
!this.model.isEmpty ||
!this.element.isEmpty ||
!this.aspect.isEmpty ||
!this.relationship.isEmpty ||
!this.font.isEmpty
);
}

Expand Down
8 changes: 5 additions & 3 deletions packages/transformer/src/IModelTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2845,7 +2845,7 @@ export class IModelTransformer extends IModelExportHandler {
if (this._csFileProps === undefined || this._csFileProps.length === 0) {
if (
this.exporter.sourceDbChanges === undefined ||
this.exporter.sourceDbChanges.isEmpty
!this.exporter.sourceDbChanges.hasChanges
)
return;
// our sourcedbChanges aren't empty (probably due to someone adding custom changes), change our sourceChangeDataState to has-changes
Expand Down Expand Up @@ -3021,7 +3021,8 @@ export class IModelTransformer extends IModelExportHandler {
const notConnectedModel = this.sourceDb.iTwinId === undefined;
const noChanges =
this.synchronizationVersion.index === this.sourceDb.changeset.index &&
this.exporter.sourceDbChanges?.isEmpty;
(this.exporter.sourceDbChanges === undefined ||
!this.exporter.sourceDbChanges.hasChanges);
if (notConnectedModel || noChanges) return;

const sourceIdOfRelationshipInTarget = await this.getTargetIdFromSourceId(
Expand Down Expand Up @@ -3089,7 +3090,8 @@ export class IModelTransformer extends IModelExportHandler {
const notConnectedModel = this.sourceDb.iTwinId === undefined;
const noChanges =
this.synchronizationVersion.index === this.sourceDb.changeset.index &&
this.exporter.sourceDbChanges?.isEmpty;
(this.exporter.sourceDbChanges === undefined ||
!this.exporter.sourceDbChanges.hasChanges);
if (notConnectedModel || noChanges) return;

let targetId = await this.getTargetIdFromSourceId(
Expand Down

0 comments on commit a5c2c76

Please sign in to comment.