From d6c9f95851d39c53d49f4961d0d880ee5a91b8bb Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Sat, 20 May 2023 08:28:27 -0500 Subject: [PATCH] Fix error about pinnable tooltips --- src/data/layers/prestige.tsx | 3 ++- src/features/tooltips/tooltip.ts | 12 ------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/data/layers/prestige.tsx b/src/data/layers/prestige.tsx index 30fe99f..6e3cb69 100644 --- a/src/data/layers/prestige.tsx +++ b/src/data/layers/prestige.tsx @@ -37,7 +37,7 @@ const layer = createLayer(id, function (this: BaseLayer) { color, reset })); - addTooltip(treeNode, { + const tooltip = addTooltip(treeNode, { display: createResourceTooltip(points), pinnable: true }); @@ -58,6 +58,7 @@ const layer = createLayer(id, function (this: BaseLayer) { name, color, points, + tooltip, display: jsx(() => ( <> diff --git a/src/features/tooltips/tooltip.ts b/src/features/tooltips/tooltip.ts index b5b1042..54d782c 100644 --- a/src/features/tooltips/tooltip.ts +++ b/src/features/tooltips/tooltip.ts @@ -95,18 +95,6 @@ export function addTooltip( } nextTick(() => { - if (options.pinnable) { - if ("pinned" in element) { - console.error( - "Cannot add pinnable tooltip to element that already has a property called 'pinned'" - ); - options.pinnable = false; - deletePersistent(options.pinned as Persistent); - } else { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (element as any).pinned = options.pinned; - } - } const elementComponent = element[Component]; element[Component] = TooltipComponent as GenericComponent; const elementGatherProps = element[GatherProps].bind(element);