Skip to content

Commit 0365026

Browse files
committed
fix init after zod schema
1 parent 7ea650f commit 0365026

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

apps/roam/src/components/settings/utils/init.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -174,25 +174,16 @@ const initSingleDiscourseNode = async (
174174
if (!existingProps || Object.keys(existingProps).length === 0) {
175175
const nodeData = DiscourseNodeSchema.parse({
176176
text: node.text,
177-
type: node.type,
177+
uid: pageUid,
178178
format: node.format || "",
179179
shortcut: node.shortcut || "",
180180
tag: node.tag || "",
181181
graphOverview: node.graphOverview ?? false,
182182
canvasSettings: node.canvasSettings || {},
183-
templateUid,
184-
indexUid,
185-
specificationUid,
186183
backedBy: "user",
187184
});
188185

189186
setBlockProps(pageUid, nodeData as Record<string, json>, false);
190-
} else if (
191-
!existingProps.templateUid ||
192-
!existingProps.indexUid ||
193-
!existingProps.specificationUid
194-
) {
195-
setBlockProps(pageUid, { templateUid, indexUid, specificationUid }, true);
196187
}
197188

198189
return { label: node.text, pageUid };

apps/roam/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import {
4141
STREAMLINE_STYLING_KEY,
4242
DISALLOW_DIAGNOSTICS,
4343
} from "./data/userSettings";
44+
import { initSchema } from "./components/settings/utils/init";
4445

4546
export const DEFAULT_CANVAS_PAGE_FORMAT = "Canvas/*";
4647

@@ -75,9 +76,8 @@ export default runExtension(async (onloadArgs) => {
7576

7677
initPluginTimer();
7778

78-
await initializeDiscourseNodes();
79-
refreshConfigTree();
80-
79+
// For testing purposes
80+
await initSchema();
8181
addGraphViewNodeStyling();
8282
registerCommandPaletteCommands(onloadArgs);
8383
createSettingsPanel(onloadArgs);

0 commit comments

Comments
 (0)