Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
164 changes: 0 additions & 164 deletions src/hooks/useAgentZeroStatusIndicator.ts

This file was deleted.

36 changes: 36 additions & 0 deletions src/hooks/useShouldSuppressConciergeIndicators.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import type {OnyxEntry} from 'react-native-onyx';
import {isCreatedAction} from '@libs/ReportActionsUtils';
import ONYXKEYS from '@src/ONYXKEYS';
import type {ReportActions} from '@src/types/onyx/ReportAction';
import useCurrentUserPersonalDetails from './useCurrentUserPersonalDetails';
import useIsInSidePanel from './useIsInSidePanel';
import useOnyx from './useOnyx';
import useSidePanelState from './useSidePanelState';

/**
* Returns true when thinking/typing indicators should be hidden in the side-panel
* welcome state — specifically for Concierge DMs before the user sends their first message.
*/
function useShouldSuppressConciergeIndicators(reportID: string | undefined): boolean {
const isInSidePanel = useIsInSidePanel();
const {sessionStartTime} = useSidePanelState();
const {accountID: currentUserAccountID} = useCurrentUserPersonalDetails();
const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);

const isConciergeChat = reportID === conciergeReportID;

const hasUserSentMessageSelector = (actions: OnyxEntry<ReportActions>) => {
if (!actions || !sessionStartTime) {
return false;
}
return Object.values(actions).some((action) => !isCreatedAction(action) && action.actorAccountID === currentUserAccountID && action.created >= sessionStartTime);
};
// eslint-disable-next-line rulesdir/no-inline-useOnyx-selector -- React Compiler handles memoization
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we remove this disabled line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so, looks like an artifact from Opus. Doing this now.

const [hasUserSentMessage] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, {
selector: hasUserSentMessageSelector,
});

return isConciergeChat && isInSidePanel && !hasUserSentMessage;
}

export default useShouldSuppressConciergeIndicators;
122 changes: 0 additions & 122 deletions src/libs/ConciergeReasoningStore.ts

This file was deleted.

Loading
Loading