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