Skip to content

Commit 2c3dd4b

Browse files
committed
Fixes for various small issues caught by sentry
1 parent bed34a7 commit 2c3dd4b

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -948,10 +948,13 @@ export class DataInspector extends Model({
948948
return;
949949
}
950950

951-
const dbState = dbCtx.get(this)!;
952-
953951
this.runningDataFetch?.abortController.abort();
954952

953+
const dbState = dbCtx.get(this);
954+
if (!dbState) {
955+
return;
956+
}
957+
955958
this.runningDataFetch = {abortController: new AbortController(), offset};
956959
dbState.setLoadingTab(DataView, true);
957960

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

-1
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,6 @@ export class QueryEditor extends Model({
819819
});
820820
return {success: true, capabilities, status};
821821
} catch (e: any) {
822-
console.error(e);
823822
this.addHistoryCell({
824823
queryData,
825824
timestamp,

shared/studio/tabs/schema/renderers/module.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ export function ModuleRenderer({
2626
if (isSticky) {
2727
const observer = new IntersectionObserver(
2828
([e]) => {
29-
if (e.boundingClientRect.top < e.rootBounds!.height / 2) {
29+
if (
30+
e.rootBounds &&
31+
e.boundingClientRect.top < e.rootBounds.height / 2
32+
) {
3033
setIsStuck(e.intersectionRatio < 1);
3134
}
3235
},

shared/studio/tabs/schema/state/textView.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ export class SchemaTextView extends Model({
144144
}
145145

146146
getRenderHeight(index: number) {
147-
const item = this.renderListItems.itemsList[index].item;
148-
return item.schemaType === "Module"
147+
const item = this.renderListItems.itemsList[index]?.item;
148+
return !item || item.schemaType === "Module"
149149
? 42
150150
: this.renderHeights.get(item.id) ?? 42;
151151
}

0 commit comments

Comments
 (0)