refac
This commit is contained in:
1 parent
8faaf2cd1e
commit
009999f363
12 files changed
+334
-32
No files matched your search
@@ -1,5 +1,6 @@
|
||||
const TEMPORARY_CHAT_ID_PREFIX = 'temporary:';
|
||||
const LEGACY_TEMPORARY_CHAT_ID_PREFIX = 'local:'; // Legacy temporary chat prefix.
|
||||
const CHANNEL_CHAT_ID_PREFIX = 'channel:';
|
||||
|
||||
export const createTemporaryChatId = (sessionId: string | undefined) =>
|
||||
`${TEMPORARY_CHAT_ID_PREFIX}${sessionId}`;
|
||||
@@ -8,3 +9,6 @@ export const isTemporaryChatId = (chatId: string | null | undefined) =>
|
||||
!!chatId &&
|
||||
(chatId.startsWith(TEMPORARY_CHAT_ID_PREFIX) ||
|
||||
chatId.startsWith(LEGACY_TEMPORARY_CHAT_ID_PREFIX));
|
||||
|
||||
export const isSavedChatId = (chatId: string | null | undefined) =>
|
||||
!!chatId && !isTemporaryChatId(chatId) && !chatId.startsWith(CHANNEL_CHAT_ID_PREFIX);
|
||||
Reference in new issue
Block a user