Search for username in compose mode

This commit is contained in:
Scott Nonnenberg 2021-11-11 17:17:29 -08:00 committed by GitHub
parent 6731cc6629
commit cbae7f8ee9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 997 additions and 72 deletions

View file

@ -107,6 +107,12 @@ export const getConversationsByGroupId = createSelector(
return state.conversationsByGroupId;
}
);
export const getConversationsByUsername = createSelector(
getConversations,
(state: ConversationsStateType): ConversationLookupType => {
return state.conversationsByUsername;
}
);
const getAllConversations = createSelector(
getConversationLookup,
@ -397,6 +403,24 @@ export const getComposerConversationSearchTerm = createSelector(
}
);
export const getIsFetchingUsername = createSelector(
getComposerState,
(composer): boolean => {
if (!composer) {
assert(false, 'getIsFetchingUsername: composer is not open');
return false;
}
if (composer.step !== ComposerStep.StartDirectConversation) {
assert(
false,
`getIsFetchingUsername: step ${composer.step} has no isFetchingUsername key`
);
return false;
}
return composer.isFetchingUsername;
}
);
function isTrusted(conversation: ConversationType): boolean {
if (conversation.type === 'group') {
return true;