diff --git a/apps/tlon-web/src/components/Sidebar/ActivityIndicator.tsx b/apps/tlon-web/src/components/Sidebar/ActivityIndicator.tsx index df462873c1..f650dfbba5 100644 --- a/apps/tlon-web/src/components/Sidebar/ActivityIndicator.tsx +++ b/apps/tlon-web/src/components/Sidebar/ActivityIndicator.tsx @@ -1,6 +1,6 @@ import cn from 'classnames'; -import { useNotifications } from '@/notifications/useNotifications'; +import { useSourceActivity } from '@/state/activity'; import { useCalmSetting } from '@/state/settings'; import BellIcon from '../icons/BellIcon'; @@ -40,7 +40,7 @@ export default function ActivityIndicator({ } export function ActivitySidebarItem() { - const { activity } = useNotifications(); + const { activity } = useSourceActivity('base'); const activeTab = useActiveTab(); return ( diff --git a/apps/tlon-web/src/components/Sidebar/AppNav.tsx b/apps/tlon-web/src/components/Sidebar/AppNav.tsx index e4c6d852e7..fa1f9d6f71 100644 --- a/apps/tlon-web/src/components/Sidebar/AppNav.tsx +++ b/apps/tlon-web/src/components/Sidebar/AppNav.tsx @@ -9,11 +9,11 @@ import { isNativeApp, useSafeAreaInsets } from '@/logic/native'; import useAppUpdates, { AppUpdateContext } from '@/logic/useAppUpdates'; import { useIsDark, useIsMobile } from '@/logic/useMedia'; import useShowTabBar from '@/logic/useShowTabBar'; -import { useNotifications } from '@/notifications/useNotifications'; import { useCombinedChatUnreads, useCombinedGroupUnreads, useMarkAllGroupsRead, + useSourceActivity, } from '@/state/activity'; import { useCharge } from '@/state/docket'; import { useLocalState } from '@/state/local'; @@ -220,7 +220,7 @@ function MessagesTab(props: { isInactive: boolean; isDarkMode: boolean }) { function ActivityTab(props: { isInactive: boolean; isDarkMode: boolean }) { const navigate = useNavigate(); - const { activity } = useNotifications(); + const { activity } = useSourceActivity('base'); const isMobile = useIsMobile(); if (isMobile) { diff --git a/desk/app/activity.hoon b/desk/app/activity.hoon index 2bf9aa698c..d1a13b44c2 100644 --- a/desk/app/activity.hoon +++ b/desk/app/activity.hoon @@ -249,7 +249,7 @@ %add (add-event +.action) %bump (bump +.action) %del (del-source +.action) - %read (read source.action read-action.action) + %read (read source.action read-action.action |) %adjust (adjust +.action) %allow-notifications (allow +.action) == @@ -730,7 +730,7 @@ %- (log |.("sending activity: {}")) (give-update [%activity new-activity] [%hose ~]) ++ read - |= [=source:a action=read-action:a] + |= [=source:a action=read-action:a from-parent=?] ^+ cor =/ =index:a (get-index source) ?- -.action @@ -753,11 +753,13 @@ |- ?~ children cor =/ =source:a i.children - =. cor (read source action) + =. cor (read source action &) $(children t.children) :: we need to refresh our own index to reflect new reads %- (log |.("refeshing index: {}")) =. indices (~(put by indices) source new) + ?: from-parent + (refresh-summary source) =. cor (refresh source) =/ new-activity=activity:a %+ roll diff --git a/packages/shared/src/urbit/activity.ts b/packages/shared/src/urbit/activity.ts index 2ece3cf976..1f2c9c99e6 100644 --- a/packages/shared/src/urbit/activity.ts +++ b/packages/shared/src/urbit/activity.ts @@ -692,20 +692,13 @@ export function getSource(bundle: ActivityBundle): Source { if ('flag-post' in top) { return { - channel: { - nest: top['flag-post'].channel, - group: top['flag-post'].group, - }, + group: top['flag-post'].group, }; } if ('flag-reply' in top) { return { - thread: { - key: top['flag-reply'].parent, - channel: top['flag-reply'].channel, - group: top['flag-reply'].group, - }, + group: top['flag-reply'].group, }; }