Skip to content

Commit def877f

Browse files
committed
Use backend query for node migration
1 parent 14e72c9 commit def877f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,14 @@ const migrateSection = ({
110110
return true;
111111
};
112112

113-
const migrateDiscourseNodes = (): boolean => {
114-
const nodePages = window.roamAlphaAPI.data.fast.q(`
113+
const migrateDiscourseNodes = async (): Promise<boolean> => {
114+
const nodePages = (await window.roamAlphaAPI.data.backend.q(`
115115
[:find ?uid ?title
116116
:where
117117
[?page :node/title ?title]
118118
[?page :block/uid ?uid]
119119
[(clojure.string/starts-with? ?title "${DISCOURSE_NODE_PAGE_PREFIX}")]]
120-
`) as [string, string][];
120+
`)) as [string, string][];
121121

122122
let allOk = true;
123123

@@ -241,7 +241,7 @@ export const migrateGraphLevel = async (
241241
}
242242
}
243243

244-
if (!migrateDiscourseNodes()) {
244+
if (!(await migrateDiscourseNodes())) {
245245
failures++;
246246
}
247247

0 commit comments

Comments
 (0)