mirror of
https://github.com/logseq/logseq.git
synced 2026-05-27 06:04:23 +00:00
Previously, `[:frontend.db.react/refs id]` is used for three places: 1. get-page-referenced-blocks 2. get-block-referenced-blocks 3. get-block-references-count The cached query atom will be shared between those three functions, the problem is that both queries in `get-page-referenced-blocks` and `get-block-referenced-blocks` return data of different formats, which can result in crashes in some situations (e.g. PR #8423). This commit removed `get-block-references-count` and use `model/pull-block` and `(count (:block/_refs block))` instead. We also need to make sure the `id` in `[:frontend.db.react/refs id]` will be different for `get-page-referenced-blocks` and `get-block-referenced-blocks`. We can probably get rid of `get-page-referenced-blocks` once we refactored both linked references and filters for pages.