Skip to content

Commit

Permalink
fix: New block selection
Browse files Browse the repository at this point in the history
  • Loading branch information
surajshetty3416 committed Jan 17, 2024
1 parent 074dbb5 commit 7c2bfce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions frontend/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ const useStore = defineStore("store", {
.then((data: { message: { [key: string]: [] } }) => {
this.pageData = data.message;
})
.catch((e: { exc: string }) => {
const error_message = e.exc.split("\n").slice(-2)[0];
.catch((e: { exc: string | null }) => {
const error_message = e.exc?.split("\n").slice(-2)[0];
toast.error("There was an error while fetching page data", {
description: error_message,
});
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/utils/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,9 @@ class Block implements BlockOptions {
}
selectBlock() {
const store = useStore();
store.selectBlock(this, null);
nextTick(() => {
store.selectBlock(this, null);
});
}
getParentBlock(): Block | null {
const store = useStore();
Expand Down

0 comments on commit 7c2bfce

Please sign in to comment.