mirror of
https://github.com/zadam/trilium.git
synced 2025-12-24 00:59:55 +01:00
chore(breadcrumb_badges/backlinks): display actual count of backlinks
This commit is contained in:
@@ -5,7 +5,7 @@ import { ComponentChildren, MouseEventHandler } from "preact";
|
||||
import { useRef } from "preact/hooks";
|
||||
|
||||
import { t } from "../services/i18n";
|
||||
import { BacklinksList } from "./FloatingButtonsDefinitions";
|
||||
import { BacklinksList, useBacklinkCount } from "./FloatingButtonsDefinitions";
|
||||
import Dropdown, { DropdownProps } from "./react/Dropdown";
|
||||
import { useIsNoteReadOnly, useNoteContext, useStaticTooltip } from "./react/hooks";
|
||||
import Icon from "./react/Icon";
|
||||
@@ -65,8 +65,8 @@ function ShareBadge() {
|
||||
}
|
||||
|
||||
function BacklinksBadge() {
|
||||
const { note } = useNoteContext();
|
||||
const count = 1;
|
||||
const { note, viewScope } = useNoteContext();
|
||||
const count = useBacklinkCount(note, viewScope?.viewMode === "default");
|
||||
return (note && count > 0 &&
|
||||
<BadgeWithDropdown
|
||||
className="backlinks-badge backlinks-widget"
|
||||
|
||||
Reference in New Issue
Block a user