mirror of
https://github.com/zadam/trilium.git
synced 2025-10-28 01:59:04 +01:00
fix(call_to_action): error if no items
This commit is contained in:
parent
27b80b573f
commit
e125809fe0
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user