Files
Desktop/ts/services/callLinksLoader.ts
2025-09-16 17:39:03 -07:00

18 lines
568 B
TypeScript

// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { DataReader } from '../sql/Client.js';
import type { CallLinkType } from '../types/CallLink.js';
import { strictAssert } from '../util/assert.js';
let callLinksData: ReadonlyArray<CallLinkType>;
export async function loadCallLinks(): Promise<void> {
callLinksData = await DataReader.getAllCallLinks();
}
export function getCallLinksForRedux(): ReadonlyArray<CallLinkType> {
strictAssert(callLinksData != null, 'callLinks has not been loaded');
return callLinksData;
}