Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

activity: fix notification paths #3824

Merged
merged 4 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion apps/tlon-web/src/notifications/Notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
getRelevancy,
getSource,
getTop,
nestToFlag,
} from '@tloncorp/shared/dist/urbit';
import { daToUnix, parseUd } from '@urbit/aura';
import _ from 'lodash';
Expand Down Expand Up @@ -39,7 +40,10 @@ function getPath(source: Source, event: ActivityEvent): string {
'reply' in event
? `?reply=${parseUd(event.reply.key.time).toString()}`
: '';
return `/groups/${source.thread.group}/channels/${source.thread.channel}/message/${parseUd(source.thread.key.time).toString()}${suffix}`;
const [app] = nestToFlag(source.thread.channel);
const postType =
app === 'chat' ? 'message' : app === 'diary' ? 'note' : 'curio';
return `/groups/${source.thread.group}/channels/${source.thread.channel}/${postType}/${parseUd(source.thread.key.time).toString()}${suffix}`;
}

if ('dm-thread' in source) {
Expand Down
7 changes: 5 additions & 2 deletions desk/app/activity.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,8 @@
=/ collapsed
(~(gas in collapsed.acc) (turn top head))
:- (~(put by sources.acc) source src-info(added &))
[(sub limit.acc 1) (snoc happenings.acc [source time top]) collapsed]
=/ happening [source (head (head top)) top]
[(sub limit.acc 1) (snoc happenings.acc happening) collapsed]
arthyn marked this conversation as resolved.
Show resolved Hide resolved
+$ out
$: sources=(map source:a [latest=time-id:a added=?])
limit=@ud
Expand Down Expand Up @@ -771,7 +772,9 @@
++ bump
|= =source:a
^+ cor
=/ =index:a (~(got by indices) source)
:: we use get-index here because this source may not exist especially
:: if it was a post we created and then commented on w/o any other activity
=/ =index:a (get-index source)
=/ new=index:a index(bump now.bowl)
=. indices
(~(put by indices) source new)
Expand Down