@@ -286,21 +286,22 @@ const AttributeConfigPanel = ({
286
286
} , [ configUid ] ) ;
287
287
const [ attributesInGraph , setAttributesInGraph ] = useState < string [ ] > ( [ ] ) ;
288
288
const [ noAttributesInGraph , setNoAttributesInGraph ] = useState ( false ) ;
289
- const getAttributesInGraph = ( ) => {
290
- const attributesInGraph = (
291
- window . roamAlphaAPI . data . fast . q (
289
+ const getAttributesInGraph = async ( ) => {
290
+ const results =
291
+ // @ts -ignore
292
+ ( await window . roamAlphaAPI . data . backend . q (
292
293
`[:find
293
- (pull ?page [:node/title])
294
- :where
295
- [?b :attrs/lookup _]
296
- [?b :entity/attrs ?a]
297
- [(untuple ?a) [[?c ?d]]]
298
- [(get ?d :value) ?s]
299
- [(untuple ?s) [?e ?uid]]
300
- [?page :block/uid ?uid]
301
- ]`
302
- ) as [ PullBlock ] [ ]
303
- ) . map ( ( p ) => p [ 0 ] ?. [ ":node/title" ] || "" ) ;
294
+ (pull ?page [:node/title])
295
+ :where
296
+ [?b :attrs/lookup _]
297
+ [?b :entity/attrs ?a]
298
+ [(untuple ?a) [[?c ?d]]]
299
+ [(get ?d :value) ?s]
300
+ [(untuple ?s) [?e ?uid]]
301
+ [?page :block/uid ?uid]
302
+ ]`
303
+ ) ) as [ PullBlock ] [ ] ;
304
+ const attributesInGraph = results . map ( ( p ) => p [ 0 ] ?. [ ":node/title" ] || "" ) ;
304
305
if ( attributesInGraph . length === 0 ) {
305
306
setNoAttributesInGraph ( true ) ;
306
307
} else {
@@ -389,8 +390,8 @@ const AttributeConfigPanel = ({
389
390
loading = { isLoading }
390
391
onClick = { ( ) => {
391
392
setIsLoading ( true ) ;
392
- setTimeout ( ( ) => {
393
- getAttributesInGraph ( ) ;
393
+ setTimeout ( async ( ) => {
394
+ await getAttributesInGraph ( ) ;
394
395
395
396
setIsLoading ( false ) ;
396
397
focusAndOpenSelect ( ) ;
0 commit comments