pl-fe: fix after react-query update
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
3dfba3502e
commit
8898de7bfb
2 changed files with 3 additions and 3 deletions
|
@ -25,7 +25,7 @@ const useAnnouncements = () => {
|
|||
const result = useQuery<ReadonlyArray<AdminAnnouncement>>({
|
||||
queryKey: ['admin', 'announcements'],
|
||||
queryFn: getAnnouncements,
|
||||
placeholderData: [],
|
||||
placeholderData: [] as ReadonlyArray<AdminAnnouncement>,
|
||||
});
|
||||
|
||||
const {
|
||||
|
|
|
@ -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} />
|
||||
|
|
Loading…
Reference in a new issue