Added toast when navigating out of bounds of event pages

This commit is contained in:
Alexis
2024-11-27 14:07:18 +01:00
parent bba01fdcf1
commit 6a68105a0f
2 changed files with 14 additions and 1 deletions

View File

@@ -2,9 +2,13 @@
import { type RPGDate } from "@/models/Date"
import { PhArrowLineLeft, PhArrowLineRight } from "@phosphor-icons/vue"
import { useToast } from "../ui/toast";
const { currentDate, currentConfig, jumpToDate, getRelativeEventFromDate } = useCalendar()
const { toast } = useToast()
const { t } = useI18n()
function handleGotoPreviousEventPage(position: "next" | "prev" = "next") {
let fromDate: RPGDate
@@ -55,7 +59,12 @@ function handleGotoPreviousEventPage(position: "next" | "prev" = "next") {
jumpToDate(targetDate)
} catch (err) {
console.log(err)
toast({
title: t("entity.calendar.event.outOfBoundsTitle"),
variant: "default",
description: t("entity.calendar.event.outOfBoundsMessage"),
duration: 4000,
})
}
}
</script>