Skip to content

Commit

Permalink
Fix _refreshData getting called on DataInspector unmount
Browse files Browse the repository at this point in the history
  • Loading branch information
jaclarke committed Aug 8, 2024
1 parent ceeb1da commit 9902ff4
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions shared/studio/tabs/dataview/state/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,22 +317,24 @@ export class DataInspector extends Model({
this._updateRowCount();

const updateFieldDisposer = reaction(
() => [this.objectType] as const,
([objectType]) => {
() => this.objectType,
(objectType) => {
if (objectType) {
this._updateFields();
}
}
);
const refreshDataDisposer = reaction(
() => [sessionStateCtx.get(this)?.activeState],
() => {
this.omittedLinks.clear();
this._refreshData(true);
() => sessionStateCtx.get(this)?.activeState,
(state) => {
if (state) {
this.omittedLinks.clear();
this._refreshData(true);
}
}
);
const refreshSubtypesDataDisposer = reaction(
() => [this.fields],
() => this.fields,
() => {
this.omittedLinks.clear();
this._refreshData(false, true);
Expand Down Expand Up @@ -517,9 +519,7 @@ export class DataInspector extends Model({

@computed
get insertTypeNames() {
const objectType = dbCtx
.get(this)!
.schemaData?.objects.get(this.objectTypeId);
const objectType = this.objectType;

if (!objectType) {
return [];
Expand Down

0 comments on commit 9902ff4

Please sign in to comment.