Fix DM reminders trying to load guild data

This commit is contained in:
jude
2024-06-06 16:56:19 +01:00
parent 5e82a687f9
commit 8881ef0f85
8 changed files with 42 additions and 11 deletions

View File

@ -11,12 +11,7 @@ enum Sort {
}
export const UserReminders = () => {
const {
isSuccess,
isFetching,
isFetched,
data: guildReminders,
} = useQuery(fetchUserReminders());
const { isSuccess, isFetching, isFetched, data: reminders } = useQuery(fetchUserReminders());
const [collapsed, setCollapsed] = useState(false);
const [sort, setSort] = useState(Sort.Time);
@ -85,7 +80,7 @@ export const UserReminders = () => {
<div id={"guildReminders"} className={isFetching ? "loading" : ""}>
{isSuccess &&
guildReminders
reminders
.sort((r1, r2) => {
if (sort === Sort.Time) {
return r1.utc_time > r2.utc_time ? 1 : -1;