diff options
Diffstat (limited to 'src/client/views/nodes/ImageBox.tsx')
-rw-r--r-- | src/client/views/nodes/ImageBox.tsx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx index fb2346bd1..617a09ed5 100644 --- a/src/client/views/nodes/ImageBox.tsx +++ b/src/client/views/nodes/ImageBox.tsx @@ -99,7 +99,6 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { // variables for AI Image Editor @observable private _regenInput = ''; - @observable private _canInteract = true; @observable private _regenerateLoading = false; // Add these observable properties to the ImageBox class @@ -716,7 +715,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { @computed get nativeSize() { TraceMobx(); - if (this.paths.length && this.paths[0].includes(DefaultPath)) return { nativeWidth: NumCast(this.layoutDoc._width), nativeHeight: NumCast(this.layoutDoc._height), nativeOrientation: 0 }; + if (this.paths[0]?.includes(DefaultPath) && this.layoutDoc._height) return { nativeWidth: NumCast(this.layoutDoc._width), nativeHeight: NumCast(this.layoutDoc._height), nativeOrientation: 0 }; const { nativeWidth, nativeHeight } = this.imgNativeSize; const nativeOrientation = NumCast(this.dataDoc[this.fieldKey + '_nativeOrientation'], 1); return { nativeWidth, nativeHeight, nativeOrientation }; @@ -902,7 +901,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { aria-label="Edit instructions input" type="text" value={this._regenInput || StrCast(this.Document.title)} - onChange={action(e => this._canInteract && (this._regenInput = e.target.value))} + onChange={action(e => (this._regenInput = e.target.value))} placeholder={this._regenInput || StrCast(this.Document.title)} /> <div className="imageBox-aiView-regenerate-createBtn"> @@ -936,7 +935,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { number={this._fireflyRefStrength} size={Size.XXSMALL} setNumber={undoable( - action(val => this._canInteract && (this._fireflyRefStrength = val as number)), + action(val => (this._fireflyRefStrength = val as number)), `${this.Document.title} button set from list` )} fillWidth |