fix(call_to_action): error if no items

This commit is contained in:
Elian Doran 2025-08-12 17:42:18 +03:00
parent 27b80b573f
commit e125809fe0
No known key found for this signature in database

View File

@ -21,7 +21,7 @@ const CALL_TO_ACTIONS: CallToAction[] = [
{
title: "TriliumNext theme is now stable",
message: "For a while now, we've been working on a new theme to give the application a more modern look.",
enabled: isNextTheme,
enabled: () => !isNextTheme(),
buttons: [
{ text: "Switch to the TriliumNext theme"}
]
@ -41,6 +41,10 @@ function CallToActionDialogComponent({ activeCallToActions }: { activeCallToActi
const [ shown, setShown ] = useState(true);
const activeItem = activeCallToActions[activeIndex];
if (!activeCallToActions.length) {
return <></>;
}
function goToNext() {
if (activeIndex + 1 < activeCallToActions.length) {
setActiveIndex(activeIndex + 1);