Skip to content

Commit 1a07243

Browse files
committed
cur progress addressing PR comments
1 parent b62e746 commit 1a07243

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

apps/roam/src/components/ModifyNodeDialog.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,13 @@ const ModifyNodeDialog = ({
178178
}
179179
} catch (error) {
180180
if (contentRequestIdRef.current === req && alive) {
181-
console.error("Error fetching content options:", error);
181+
renderToast({
182+
id: `discourse-node-error-${Date.now()}`,
183+
intent: "danger",
184+
content: (
185+
<span>Error fetching content options: {String(error)}</span>
186+
),
187+
});
182188
}
183189
} finally {
184190
if (contentRequestIdRef.current === req && alive) {
@@ -313,7 +319,6 @@ const ModifyNodeDialog = ({
313319
nodeType: selectedNodeType.type,
314320
blockUid: sourceBlockUid,
315321
});
316-
console.log("formattedTitle", formattedTitle);
317322
}
318323
if (!formattedTitle) {
319324
return;

apps/roam/src/components/canvas/DiscourseNodeUtil.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import {
4646
import { getSetting } from "~/utils/extensionSettings";
4747
import DiscourseContextOverlay from "~/components/DiscourseContextOverlay";
4848
import { getDiscourseNodeColors } from "~/utils/getDiscourseNodeColors";
49-
import { OnloadArgs } from "roamjs-components/types";
49+
import { render as renderToast } from "roamjs-components/components/Toast";
5050

5151
// TODO REPLACE WITH TLDRAW DEFAULTS
5252
// https://github.com/tldraw/tldraw/pull/1580/files
@@ -555,10 +555,13 @@ export class BaseDiscourseNodeUtil extends ShapeUtil<DiscourseNodeShape> {
555555
finalUid,
556556
});
557557
} catch (error) {
558-
console.error(
559-
"[DiscourseNodeUtil] Error creating relations:",
560-
error,
561-
);
558+
renderToast({
559+
id: `discourse-node-error-${Date.now()}`,
560+
intent: "danger",
561+
content: (
562+
<span>Error creating relations: {String(error)}</span>
563+
),
564+
});
562565
}
563566
}
564567

apps/roam/src/components/canvas/uiOverrides.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,8 @@ export const getOnSelectForShape = ({
152152
imageUrl: src,
153153
onSuccess: async ({ text, uid, newPageUid }) => {
154154
const finalUid = newPageUid || uid;
155-
// Delete the original image shape
156155
editor.deleteShapes([shape.id]);
157156

158-
// Create the discourse node shape
159157
const { h, w, imageUrl } = await calcCanvasNodeSizeAndImg({
160158
nodeText: text,
161159
extensionAPI,

apps/roam/src/utils/formatUtils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import getDiscourseNodes, { DiscourseNode } from "./getDiscourseNodes";
66
import compileDatalog from "./compileDatalog";
77
import discourseNodeFormatToDatalog from "./discourseNodeFormatToDatalog";
88
import createOverlayRender from "roamjs-components/util/createOverlayRender";
9-
import { render as renderToast } from "roamjs-components/components/Toast";
10-
import FormDialog from "roamjs-components/components/FormDialog";
119
import { QBClause, Result } from "./types";
1210
import findDiscourseNode from "./findDiscourseNode";
1311
import extractTag from "roamjs-components/util/extractTag";

0 commit comments

Comments
 (0)