Files
Desktop/ts/services/chatFoldersLoader.ts
2025-10-10 15:34:28 -07:00

18 lines
597 B
TypeScript

// Copyright 2025 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { DataReader } from '../sql/Client.js';
import type { CurrentChatFolder } from '../types/CurrentChatFolders.js';
import { strictAssert } from '../util/assert.js';
let chatFolders: ReadonlyArray<CurrentChatFolder>;
export async function loadChatFolders(): Promise<void> {
chatFolders = await DataReader.getCurrentChatFolders();
}
export function getChatFoldersForRedux(): ReadonlyArray<CurrentChatFolder> {
strictAssert(chatFolders != null, 'chatFolders has not been loaded');
return chatFolders;
}