(context?: TipContext)
| 666 | } |
| 667 | |
| 668 | export async function getRelevantTips(context?: TipContext): Promise<Tip[]> { |
| 669 | const settings = getInitialSettings() |
| 670 | const override = settings.spinnerTipsOverride |
| 671 | const customTips = getCustomTips() |
| 672 | |
| 673 | // If excludeDefault is true and there are custom tips, skip built-in tips entirely |
| 674 | if (override?.excludeDefault && customTips.length > 0) { |
| 675 | return customTips |
| 676 | } |
| 677 | |
| 678 | // Otherwise, filter built-in tips as before and combine with custom |
| 679 | const tips = [...externalTips, ...internalOnlyTips] |
| 680 | const isRelevant = await Promise.all(tips.map(_ => _.isRelevant(context))) |
| 681 | const filtered = tips |
| 682 | .filter((_, index) => isRelevant[index]) |
| 683 | .filter(_ => getSessionsSinceLastShown(_.id) >= _.cooldownSessions) |
| 684 | |
| 685 | return [...filtered, ...customTips] |
| 686 | } |
| 687 |
no test coverage detected