Skip to content

Commit 9ca3de7

Browse files
committed
Fix _refreshData getting called on DataInspector unmount
1 parent d80abd7 commit 9ca3de7

File tree

1 file changed

+10
-10
lines changed
  • shared/studio/tabs/dataview/state

1 file changed

+10
-10
lines changed

shared/studio/tabs/dataview/state/index.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -317,22 +317,24 @@ export class DataInspector extends Model({
317317
this._updateRowCount();
318318

319319
const updateFieldDisposer = reaction(
320-
() => [this.objectType] as const,
321-
([objectType]) => {
320+
() => this.objectType,
321+
(objectType) => {
322322
if (objectType) {
323323
this._updateFields();
324324
}
325325
}
326326
);
327327
const refreshDataDisposer = reaction(
328-
() => [sessionStateCtx.get(this)?.activeState],
329-
() => {
330-
this.omittedLinks.clear();
331-
this._refreshData(true);
328+
() => sessionStateCtx.get(this)?.activeState,
329+
(state) => {
330+
if (state) {
331+
this.omittedLinks.clear();
332+
this._refreshData(true);
333+
}
332334
}
333335
);
334336
const refreshSubtypesDataDisposer = reaction(
335-
() => [this.fields],
337+
() => this.fields,
336338
() => {
337339
this.omittedLinks.clear();
338340
this._refreshData(false, true);
@@ -517,9 +519,7 @@ export class DataInspector extends Model({
517519

518520
@computed
519521
get insertTypeNames() {
520-
const objectType = dbCtx
521-
.get(this)!
522-
.schemaData?.objects.get(this.objectTypeId);
522+
const objectType = this.objectType;
523523

524524
if (!objectType) {
525525
return [];

0 commit comments

Comments
 (0)