mirror of
https://github.com/zadam/trilium.git
synced 2025-10-29 10:39:00 +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",
|
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.",
|
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: [
|
buttons: [
|
||||||
{ text: "Switch to the TriliumNext theme"}
|
{ text: "Switch to the TriliumNext theme"}
|
||||||
]
|
]
|
||||||
@ -41,6 +41,10 @@ function CallToActionDialogComponent({ activeCallToActions }: { activeCallToActi
|
|||||||
const [ shown, setShown ] = useState(true);
|
const [ shown, setShown ] = useState(true);
|
||||||
const activeItem = activeCallToActions[activeIndex];
|
const activeItem = activeCallToActions[activeIndex];
|
||||||
|
|
||||||
|
if (!activeCallToActions.length) {
|
||||||
|
return <></>;
|
||||||
|
}
|
||||||
|
|
||||||
function goToNext() {
|
function goToNext() {
|
||||||
if (activeIndex + 1 < activeCallToActions.length) {
|
if (activeIndex + 1 < activeCallToActions.length) {
|
||||||
setActiveIndex(activeIndex + 1);
|
setActiveIndex(activeIndex + 1);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user