Skip to content

Commit

Permalink
Fixes for various small issues caught by sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
jaclarke committed Jan 16, 2025
1 parent bed34a7 commit 2c3dd4b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
7 changes: 5 additions & 2 deletions shared/studio/tabs/dataview/state/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -948,10 +948,13 @@ export class DataInspector extends Model({
return;
}

const dbState = dbCtx.get(this)!;

this.runningDataFetch?.abortController.abort();

const dbState = dbCtx.get(this);
if (!dbState) {
return;
}

this.runningDataFetch = {abortController: new AbortController(), offset};
dbState.setLoadingTab(DataView, true);

Expand Down
1 change: 0 additions & 1 deletion shared/studio/tabs/queryEditor/state/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,6 @@ export class QueryEditor extends Model({
});
return {success: true, capabilities, status};
} catch (e: any) {
console.error(e);
this.addHistoryCell({
queryData,
timestamp,
Expand Down
5 changes: 4 additions & 1 deletion shared/studio/tabs/schema/renderers/module.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ export function ModuleRenderer({
if (isSticky) {
const observer = new IntersectionObserver(
([e]) => {
if (e.boundingClientRect.top < e.rootBounds!.height / 2) {
if (
e.rootBounds &&
e.boundingClientRect.top < e.rootBounds.height / 2
) {
setIsStuck(e.intersectionRatio < 1);
}
},
Expand Down
4 changes: 2 additions & 2 deletions shared/studio/tabs/schema/state/textView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ export class SchemaTextView extends Model({
}

getRenderHeight(index: number) {
const item = this.renderListItems.itemsList[index].item;
return item.schemaType === "Module"
const item = this.renderListItems.itemsList[index]?.item;
return !item || item.schemaType === "Module"
? 42
: this.renderHeights.get(item.id) ?? 42;
}
Expand Down

0 comments on commit 2c3dd4b

Please sign in to comment.