diff options
Diffstat (limited to 'src/state/messages/convo/util.ts')
-rw-r--r-- | src/state/messages/convo/util.ts | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/state/messages/convo/util.ts b/src/state/messages/convo/util.ts index 200d85dfa..92046cf1f 100644 --- a/src/state/messages/convo/util.ts +++ b/src/state/messages/convo/util.ts @@ -8,17 +8,21 @@ import { } from './types' /** - * Checks if a `Convo` has a `status` that is "active", meaning the chat is - * loaded and ready to be used, or its in a suspended or background state, and - * ready for resumption. + * States where the convo is ready to be used - either ready, or backgrounded/suspended + * and ready to be resumed */ -export function isConvoActive( - convo: ConvoState, -): convo is +export type ActiveConvoStates = | ConvoStateReady | ConvoStateBackgrounded | ConvoStateSuspended - | ConvoStateDisabled { + | ConvoStateDisabled + +/** + * Checks if a `Convo` has a `status` that is "active", meaning the chat is + * loaded and ready to be used, or its in a suspended or background state, and + * ready for resumption. + */ +export function isConvoActive(convo: ConvoState): convo is ActiveConvoStates { return ( convo.status === ConvoStatus.Ready || convo.status === ConvoStatus.Backgrounded || |