pl-fe: fix after react-query update

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-09-22 21:18:22 +02:00
parent 3dfba3502e
commit 8898de7bfb
2 changed files with 3 additions and 3 deletions

View file

@ -25,7 +25,7 @@ const useAnnouncements = () => {
const result = useQuery<ReadonlyArray<AdminAnnouncement>>({
queryKey: ['admin', 'announcements'],
queryFn: getAnnouncements,
placeholderData: [],
placeholderData: [] as ReadonlyArray<AdminAnnouncement>,
});
const {

View file

@ -88,7 +88,7 @@ const Announcements: React.FC = () => {
const intl = useIntl();
const { openModal } = useModalsStore();
const { data: announcements, isLoading } = useAnnouncements();
const { data: announcements, isLoading, isPending } = useAnnouncements();
const handleCreateAnnouncement = () => {
openModal('EDIT_ANNOUNCEMENT');
@ -112,7 +112,7 @@ const Announcements: React.FC = () => {
emptyMessage={emptyMessage}
itemClassName='py-3 first:pt-0 last:pb-0'
isLoading={isLoading}
showLoading={isLoading && !announcements?.length}
showLoading={isLoading && isPending}
>
{announcements!.map((announcement) => (
<Announcement key={announcement.id} announcement={announcement} />