interface: correctly handle DM notifications

This commit is contained in:
Liam Fitzgerald 2020-11-12 14:47:24 +10:00
parent f97fe15d7a
commit e3876ccc63
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB
3 changed files with 13 additions and 3 deletions

View File

@ -74,7 +74,8 @@ export function ChatNotification(props: {
/>
<Col pb="3" pl="5">
{_.map(_.take(contents, 5), (content, idx) => {
const to = `/~landscape${groupPath}/resource/chat${appPath}?msg=${content.number}`;
const workspace = group?.hidden ? '/home' : groupPath;
const to = `/~landscape${workspace}/resource/chat${appPath}?msg=${content.number}`;
return (
<Link key={idx} to={to}>
<ChatMessage

View File

@ -3,7 +3,7 @@ import f from "lodash/fp";
import _ from "lodash";
import { Icon, Col, Row, Box, Text, Anchor } from "@tlon/indigo-react";
import moment from "moment";
import { Notifications, Rolodex, Timebox, IndexedNotification } from "~/types";
import { Notifications, Rolodex, Timebox, IndexedNotification, Groups } from "~/types";
import { MOMENT_CALENDAR_DATE, daToUnix } from "~/logic/lib/util";
import { BigInteger } from "big-integer";
import GlobalApi from "~/logic/api/global";
@ -35,6 +35,7 @@ function filterNotification(associations: Associations, groups: string[]) {
export default function Inbox(props: {
notifications: Notifications;
archive: Notifications;
groups: Groups;
showArchive?: boolean;
api: GlobalApi;
associations: Associations;
@ -129,6 +130,7 @@ export default function Inbox(props: {
contacts={props.contacts}
archive={!!props.showArchive}
associations={props.associations}
groups={props.groups}
graphConfig={props.notificationsGraphConfig}
groupConfig={props.notificationsGroupConfig}
chatConfig={props.notificationsChatConfig}
@ -147,6 +149,7 @@ export default function Inbox(props: {
archive={!!props.showArchive}
associations={props.associations}
api={api}
groups={props.groups}
graphConfig={props.notificationsGraphConfig}
groupConfig={props.notificationsGroupConfig}
chatConfig={props.notificationsChatConfig}
@ -170,6 +173,7 @@ function sortIndexedNotification(
function DaySection({
contacts,
groups,
archive,
timeboxes,
latest = false,
@ -210,6 +214,7 @@ function DaySection({
notification={not}
archived={archive}
contacts={contacts}
groups={groups}
time={date}
/>
</React.Fragment>

View File

@ -8,7 +8,9 @@ import {
NotificationGraphConfig,
GroupNotificationsConfig,
NotifIndex,
Groups,
Associations,
Contacts,
} from "~/types";
import GlobalApi from "~/logic/api/global";
import { getParentIndex } from "~/logic/lib/notification";
@ -24,6 +26,8 @@ interface NotificationProps {
associations: Associations;
api: GlobalApi;
archived: boolean;
groups: Groups;
contacts: Contacts;
graphConfig: NotificationGraphConfig;
groupConfig: GroupNotificationsConfig;
chatConfig: string[];
@ -172,7 +176,7 @@ export function Notification(props: NotificationProps) {
contacts={props.contacts}
read={read}
archived={archived}
groups={{}}
groups={props.groups}
timebox={props.time}
time={time}
associations={associations}