Skip to content

Commit f3d4630

Browse files
committed
lint and remove unnecessary change
1 parent e5876cc commit f3d4630

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

apps/roam/src/components/ModifyNodeDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ const ModifyNodeDialog = ({
183183
});
184184
return results.map((r) => ({
185185
...r,
186-
_discourseNodeType: node.type,
186+
discourseNodeType: node.type,
187187
}));
188188
}),
189189
);

apps/roam/src/utils/registerCommandPaletteCommands.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,19 @@ export const registerCommandPaletteCommands = (onloadArgs: OnloadArgs) => {
189189

190190
const selectionStart = uid ? getSelectionStartForBlock(uid) : 0;
191191

192+
const defaultNodeType =
193+
getDiscourseNodes().filter(excludeDefaultNodes)[0]?.type;
194+
if (!defaultNodeType) {
195+
renderToast({
196+
id: "create-discourse-node-command-no-types",
197+
content: "No discourse node types found in settings.",
198+
});
199+
return;
200+
}
201+
192202
renderModifyNodeDialog({
193203
mode: "create",
194-
nodeType: "",
204+
nodeType: defaultNodeType,
195205
initialValue: { text: "", uid: "" },
196206
extensionAPI,
197207
onSuccess: async (result) => {

0 commit comments

Comments
 (0)