From 108aff663ec487ac9406a51a5693dfb1dfddebbb Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Mon, 22 Jan 2024 14:45:47 +0100 Subject: [PATCH] FIX: User-tips regression in #25361 (#25367) It's a set of Tip objects, not ids --- app/assets/javascripts/discourse/app/services/user-tips.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/app/services/user-tips.js b/app/assets/javascripts/discourse/app/services/user-tips.js index f45e89ba3fe..005881a5a17 100644 --- a/app/assets/javascripts/discourse/app/services/user-tips.js +++ b/app/assets/javascripts/discourse/app/services/user-tips.js @@ -13,11 +13,12 @@ export default class UserTips extends Service { #shouldRenderSet = new TrackedSet(); #updateRenderedId() { - if (this.#availableTips.has(this.#renderedId)) { + const tipsArray = [...this.#availableTips]; + if (tipsArray.find((tip) => tip.id === this.#renderedId)) { return; } - const newId = [...this.#availableTips] + const newId = tipsArray .sortBy("priority") .reverse() .find((tip) => {