Files
beenvoice/apps/mobile/lib/time-clock-prefs.ts
T
soconnor d057ba208d Add 'apps/mobile/' from commit '5fa30f365f21531094cd4d2045042bb4f1370ac3'
git-subtree-dir: apps/mobile
git-subtree-mainline: 86f8987dff
git-subtree-split: 5fa30f365f
2026-08-16 21:42:59 -04:00

22 lines
667 B
TypeScript

import AsyncStorage from "@react-native-async-storage/async-storage";
function storageKey(accountId: string) {
return `beenvoice:time-clock:last-client:${accountId}`;
}
export async function getLastTimeClockClientId(accountId: string): Promise<string | null> {
return AsyncStorage.getItem(storageKey(accountId));
}
export async function setLastTimeClockClientId(
accountId: string,
clientId: string,
): Promise<void> {
if (!clientId) return;
await AsyncStorage.setItem(storageKey(accountId), clientId);
}
export async function clearTimeClockPrefsForAccount(accountId: string): Promise<void> {
await AsyncStorage.removeItem(storageKey(accountId));
}