Allow adding to a group by phone number
This commit is contained in:
19
ts/util/uuidFetchState.ts
Normal file
19
ts/util/uuidFetchState.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
// Copyright 2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
export type UUIDFetchStateKeyType = `${'username' | 'e164'}:${string}`;
|
||||
export type UUIDFetchStateType = Record<UUIDFetchStateKeyType, boolean>;
|
||||
|
||||
export const isFetchingByUsername = (
|
||||
fetchState: UUIDFetchStateType,
|
||||
username: string
|
||||
): boolean => {
|
||||
return Boolean(fetchState[`username:${username}`]);
|
||||
};
|
||||
|
||||
export const isFetchingByE164 = (
|
||||
fetchState: UUIDFetchStateType,
|
||||
e164: string
|
||||
): boolean => {
|
||||
return Boolean(fetchState[`e164:${e164}`]);
|
||||
};
|
Reference in New Issue
Block a user