diff --git a/src/pages/chat/components/Announcement.tsx b/src/pages/chat/components/Announcement.tsx index d29d79e..704882a 100644 --- a/src/pages/chat/components/Announcement.tsx +++ b/src/pages/chat/components/Announcement.tsx @@ -70,7 +70,7 @@ export default function Announcement({announcement}: { {", Zeitslot "} {pprintDateRange(entry.slotStartDate, entry.slotEndDate)} {", "} - {humanDeltaFromNow(entry.created).message} + {humanDeltaFromNow(entry.slotStartDate).message} ))} diff --git a/src/pages/events/e/:eventId/EventLists/Search/MessageEntriesModal.tsx b/src/pages/events/e/:eventId/EventLists/Search/MessageEntriesModal.tsx index 7d19e2e..3e1add3 100644 --- a/src/pages/events/e/:eventId/EventLists/Search/MessageEntriesModal.tsx +++ b/src/pages/events/e/:eventId/EventLists/Search/MessageEntriesModal.tsx @@ -9,6 +9,7 @@ import TextEditor from "@/components/input/Editor"; import ListSelect from "@/pages/events/e/:eventId/EventLists/ListSelect.tsx"; import {showSuccessNotification} from "@/components/util.tsx"; import {usePB} from "@/lib/pocketbase.tsx"; +import {useEffect} from "react"; export default function MessageEntriesModal({opened, event, onClose, query}: { @@ -34,11 +35,18 @@ export default function MessageEntriesModal({opened, event, onClose, query}: { selectedLists: [] as EventListModel[], }, validate: { - subject: hasLength({max: 255}, "Der Betreff ist zu lang"), - content: hasLength({min: 10, max: 5000}, "Die Nachricht muss zwischen 10 und 5000 Zeichen lang sein"), + subject: hasLength({max: 255}, "Der Betreff ist zu lang (max. 255 Zeichen)"), + content: hasLength({min: 10, max: 10000}, "Die Nachricht muss zwischen 10 und 10000 Zeichen lang sein"), } }) + // Fetch all pages + useEffect(() => { + if (opened && query.hasNextPage && !query.isFetchingNextPage) { + query.fetchNextPage() + } + }, [opened, query]) + const mutation = useMutation({ mutationFn: async () => { await pb.collection("messages").create({