Skip to content

Commit

Permalink
Remove destroyable management from chat messages (#17693)
Browse files Browse the repository at this point in the history
  • Loading branch information
stwlam authored Dec 13, 2024
1 parent 44020a8 commit b7bbfb7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/module/apps/sidebar/chat-log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { CheckPF2e } from "@system/check/index.ts";
import { looksLikeDamageRoll } from "@system/damage/helpers.ts";
import { DamageRoll } from "@system/damage/roll.ts";
import { fontAwesomeIcon, htmlClosest, htmlQuery, objectHasKey } from "@util";
import { createTooltipster } from "@util/destroyables.ts";
import type { ChatMessageSource } from "types/foundry/common/documents/chat-message.d.ts";

class ChatLogPF2e extends ChatLog<ChatMessagePF2e> {
Expand Down Expand Up @@ -210,7 +209,7 @@ class ChatLogPF2e extends ChatLog<ChatMessagePF2e> {

// Add a tooltipster instance to the shield button if needed.
if (!shieldButton.classList.contains("tooltipstered")) {
createTooltipster(shieldButton, {
const $shieldButton = $(shieldButton).tooltipster({
animation: "fade",
trigger: "click",
arrow: false,
Expand Down Expand Up @@ -292,7 +291,8 @@ class ChatLogPF2e extends ChatLog<ChatMessagePF2e> {

return $(contentEl);
},
}).tooltipster("open");
});
$shieldButton.tooltipster("open");
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/module/chat-message/listeners/damage-taken.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { IWRApplication } from "@system/damage/iwr.ts";
import { htmlQuery } from "@util";
import { createTooltipster } from "@util/destroyables.ts";
import { ChatMessagePF2e } from "../document.ts";

export const DamageTaken = {
Expand Down Expand Up @@ -41,7 +40,7 @@ export const DamageTaken = {
})();

if (iwrApplications) {
createTooltipster(iwrInfo, {
$(iwrInfo).tooltipster({
theme: "crb-hover",
maxWidth: 400,
content: await renderTemplate("systems/pf2e/templates/chat/damage/iwr-breakdown.hbs", {
Expand Down

0 comments on commit b7bbfb7

Please sign in to comment.