diff --git a/src/components/Feed/Beside.tsx b/src/components/Feed/Beside.tsx index 75df76af..670fd365 100644 --- a/src/components/Feed/Beside.tsx +++ b/src/components/Feed/Beside.tsx @@ -1,6 +1,6 @@ // TODO: additional entities list column + article -import type { Author, Shout, Topic, User } from '../../graphql/schema/core.gen' +import type { Author, Shout, Topic } from '../../graphql/schema/core.gen' import { clsx } from 'clsx' import { For, Show } from 'solid-js' @@ -16,7 +16,7 @@ import styles from './Beside.module.scss' type Props = { title?: string - values: (Shout | User | Topic | Author)[] + values: (Shout | Topic | Author)[] beside: Shout wrapper: 'topic' | 'author' | 'article' | 'top-article' isTopicCompact?: boolean @@ -68,7 +68,7 @@ export const Beside = (props: Props) => { })} > - {(value: Partial) => ( + {(value: Partial) => (
  • { classList={{ [styles.unread]: checkAuthorIsSeen(author.slug) }} >
    - +
    {author.name}
    diff --git a/src/components/Inbox/DialogHeader.tsx b/src/components/Inbox/DialogHeader.tsx index 1a908817..3d0b7965 100644 --- a/src/components/Inbox/DialogHeader.tsx +++ b/src/components/Inbox/DialogHeader.tsx @@ -1,4 +1,4 @@ -import type { Chat } from '../../graphql/schema/core.gen' +import type { Chat } from '../../graphql/schema/chat.gen' import DialogCard from './DialogCard' diff --git a/src/components/Inbox/GroupDialogAvatar.tsx b/src/components/Inbox/GroupDialogAvatar.tsx index f0ac1ebf..7be09b54 100644 --- a/src/components/Inbox/GroupDialogAvatar.tsx +++ b/src/components/Inbox/GroupDialogAvatar.tsx @@ -1,4 +1,4 @@ -import type { ChatMember } from '../../graphql/schema/core.gen' +import type { ChatMember } from '../../graphql/schema/chat.gen' import { clsx } from 'clsx' import { For } from 'solid-js' @@ -29,7 +29,7 @@ const GroupDialogAvatar = (props: Props) => { bordered={true} size="small" name={user.name} - url={user.userpic} + url={user.pic} /> )} diff --git a/src/components/Inbox/InviteUser.tsx b/src/components/Inbox/InviteUser.tsx index a51c714c..270de677 100644 --- a/src/components/Inbox/InviteUser.tsx +++ b/src/components/Inbox/InviteUser.tsx @@ -15,7 +15,7 @@ type DialogProps = { const InviteUser = (props: DialogProps) => { return (
    - +
    {props.author.name}
    {props.selected ? : }
    diff --git a/src/components/Inbox/Message.tsx b/src/components/Inbox/Message.tsx index bc1c3f1b..5af7e75d 100644 --- a/src/components/Inbox/Message.tsx +++ b/src/components/Inbox/Message.tsx @@ -31,7 +31,7 @@ export const Message = (props: Props) => {
    - +
    {user.name}
    diff --git a/src/components/Views/Feed/Feed.tsx b/src/components/Views/Feed/Feed.tsx index 8e25d4d2..dc93c230 100644 --- a/src/components/Views/Feed/Feed.tsx +++ b/src/components/Views/Feed/Feed.tsx @@ -13,7 +13,7 @@ import { useArticlesStore, resetSortedArticles } from '../../../stores/zine/arti import { useTopAuthorsStore } from '../../../stores/zine/topAuthors' import { useTopicsStore } from '../../../stores/zine/topics' import { getImageUrl } from '../../../utils/getImageUrl' -import { getServerDate } from '../../../utils/getServerDate' +import { getUnixtime } from '../../../utils/getServerDate' import { DropDown } from '../../_shared/DropDown' import { Icon } from '../../_shared/Icon' import { Loading } from '../../_shared/Loading' @@ -54,19 +54,21 @@ const getOrderBy = (by: FeedSearchParams['by']) => { return '' } -const getFromDate = (period: FeedPeriod): Date => { +const getFromDate = (period: FeedPeriod): number => { const now = new Date() + let d: Date = now switch (period) { case 'week': { - return new Date(now.setDate(now.getDate() - 7)) + d = new Date(now.setDate(now.getDate() - 7)) } case 'month': { - return new Date(now.setMonth(now.getMonth() - 1)) + d = new Date(now.setMonth(now.getMonth() - 1)) } case 'year': { - return new Date(now.setFullYear(now.getFullYear() - 1)) + d = new Date(now.setFullYear(now.getFullYear() - 1)) } } + return Math.floor(d.getTime() / 1000) } type Props = { @@ -153,8 +155,7 @@ export const FeedView = (props: Props) => { if (searchParams().by && searchParams().by !== 'publish_date') { const period = searchParams().period || 'month' - const fromDate = getFromDate(period) - options.filters = { fromDate: getServerDate(fromDate) } + options.filters = { after: getFromDate(period) } } return props.loadShouts(options) diff --git a/src/graphql/client/chat.ts b/src/graphql/client/chat.ts index 5cd06fc1..ceb6b195 100644 --- a/src/graphql/client/chat.ts +++ b/src/graphql/client/chat.ts @@ -21,7 +21,6 @@ import { MutationUpdate_MessageArgs, QueryLoad_ChatsArgs, QueryLoad_Messages_ByArgs, - QueryLoad_RecipientsArgs, } from '../schema/chat.gen' export const inboxClient = { @@ -72,8 +71,4 @@ export const inboxClient = { const resp = await inboxClient.private.query(chatMessagesLoadBy, options).toPromise() return resp.data.load_messages_by.messages }, - loadRecipients: async (options: QueryLoad_RecipientsArgs) => { - const resp = await inboxClient.private.query(loadRecipients, options).toPromise() - return resp.data.load_recipients.members - }, } diff --git a/src/utils/groupby.ts b/src/utils/groupby.ts index 544a7a95..04458395 100644 --- a/src/utils/groupby.ts +++ b/src/utils/groupby.ts @@ -1,4 +1,4 @@ -import type { Author, Shout, Topic } from '../graphql/types.gen' +import type { Author, Shout, Topic } from '../graphql/schema/core.gen' export const groupByName = (arr: Author[]) => { return arr.reduce( diff --git a/src/utils/sortby.ts b/src/utils/sortby.ts index 55d95bd4..99112afd 100644 --- a/src/utils/sortby.ts +++ b/src/utils/sortby.ts @@ -1,4 +1,4 @@ -import type { Author, Reaction, Shout, Stat, Topic, TopicStat } from '../graphql/types.gen' +import type { Author, Reaction, Shout, Stat, Topic, TopicStat } from '../graphql/schema/core.gen' export const byFirstChar = (a, b) => (a.name || a.title || '').localeCompare(b.name || b.title || '')