Files
Desktop/ts/services/callLinksLoader.preload.ts
T
2026-03-30 11:54:59 -07:00

18 lines
584 B
TypeScript

// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { DataReader } from '../sql/Client.preload.ts';
import type { CallLinkType } from '../types/CallLink.std.ts';
import { strictAssert } from '../util/assert.std.ts';
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;
}