ai/at
1
0

fix social-app menubar chat

This commit is contained in:
2026-01-10 14:39:29 +09:00
parent 16e11575f6
commit 0607650425

View File

@@ -1,70 +1,75 @@
diff --git a/src/state/messages/events/index.tsx b/src/state/messages/events/index.tsx --- a/src/view/shell/bottom-bar/BottomBar.tsx
index 2ff0784ae..dc314ecc5 100644 +++ b/src/view/shell/bottom-bar/BottomBar.tsx
--- a/src/state/messages/events/index.tsx @@ -198,38 +198,40 @@
+++ b/src/state/messages/events/index.tsx accessibilityLabel={_(msg`Search`)}
@@ -10,13 +10,7 @@ const MessagesEventBusContext = React.createContext<MessagesEventBus | null>( accessibilityHint=""
MessagesEventBusContext.displayName = 'MessagesEventBusContext' />
- <Btn
export function useMessagesEventBus() { - testID="bottomBarMessagesBtn"
- const ctx = React.useContext(MessagesEventBusContext) - icon={
- if (!ctx) { - isAtMessages ? (
- throw new Error( - <MessageFilled
- 'useMessagesEventBus must be used within a MessagesEventBusProvider', - width={iconWidth - 1}
- ) - style={[styles.ctrlIcon, pal.text, styles.feedsIcon]}
- } - />
- return ctx - ) : (
+ return React.useContext(MessagesEventBusContext) - <Message
} - width={iconWidth - 1}
- style={[styles.ctrlIcon, pal.text, styles.feedsIcon]}
export function MessagesEventBusProvider({ - />
@@ -24,18 +18,11 @@ export function MessagesEventBusProvider({ - )
}: { - }
children: React.ReactNode - onPress={onPressMessages}
}) { - notificationCount={numUnreadMessages.numUnread}
- const {currentAccount} = useSession() - hasNew={numUnreadMessages.hasNew}
- - accessible={true}
- if (!currentAccount) { - accessibilityRole="tab"
- return ( - accessibilityLabel={_(msg`Chat`)}
- <MessagesEventBusContext.Provider value={null}> - accessibilityHint={
- {children} - numUnreadMessages.count > 0
- </MessagesEventBusContext.Provider> - ? _(
- ) - msg`${plural(numUnreadMessages.numUnread ?? 0, {
- } - one: '# unread item',
- - other: '# unread items',
+ // DM functionality is disabled for syu.is - })}` || '',
return ( - )
- <MessagesEventBusProviderInner>{children}</MessagesEventBusProviderInner> - : ''
+ <MessagesEventBusContext.Provider value={null}> - }
+ {children} - />
+ </MessagesEventBusContext.Provider> + {!currentAccount?.isSelfHosted && (
) + <Btn
} + testID="bottomBarMessagesBtn"
+ icon={
diff --git a/src/state/queries/messages/list-conversations.tsx b/src/state/queries/messages/list-conversations.tsx + isAtMessages ? (
index c5457d1cb..5bc37bdce 100644 + <MessageFilled
--- a/src/state/queries/messages/list-conversations.tsx + width={iconWidth - 1}
+++ b/src/state/queries/messages/list-conversations.tsx + style={[styles.ctrlIcon, pal.text, styles.feedsIcon]}
@@ -74,17 +74,12 @@ export function useListConvos() { + />
+ ) : (
const empty = {accepted: [], request: []} + <Message
export function ListConvosProvider({children}: {children: React.ReactNode}) { + width={iconWidth - 1}
- const {hasSession} = useSession() + style={[styles.ctrlIcon, pal.text, styles.feedsIcon]}
- + />
- if (!hasSession) { + )
- return ( + }
- <ListConvosContext.Provider value={empty}> + onPress={onPressMessages}
- {children} + notificationCount={numUnreadMessages.numUnread}
- </ListConvosContext.Provider> + hasNew={numUnreadMessages.hasNew}
- ) + accessible={true}
- } + accessibilityRole="tab"
- + accessibilityLabel={_(msg`Chat`)}
- return <ListConvosProviderInner>{children}</ListConvosProviderInner> + accessibilityHint={
+ // DM functionality is disabled for syu.is - always return empty + numUnreadMessages.count > 0
+ return ( + ? _(
+ <ListConvosContext.Provider value={empty}> + msg`${plural(numUnreadMessages.numUnread ?? 0, {
+ {children} + one: '# unread item',
+ </ListConvosContext.Provider> + other: '# unread items',
+ ) + })}` || '',
} + )
+ : ''
export function ListConvosProviderInner({ + }
+ />
+ )}
<Btn
testID="bottomBarNotificationsBtn"
icon={