Fix uuid dependency and silent error swallowing FRE-4572

- Replace uuid package with expo-crypto randomUUID (already a dependency)
- Add error logging to darkWatchStore refreshExposures catch block
- TypeScript compiles clean
This commit is contained in:
2026-05-17 11:12:44 -04:00
parent 90a223bc79
commit 64b70073ec
2 changed files with 7 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
import { create } from 'zustand';
import { persist, createJSONStorage } from 'zustand/middleware';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { v4 as uuidv4 } from 'uuid';
import { randomUUID } from 'expo-crypto';
import type { WatchListItem, Exposure } from '@/types';
/**
@@ -29,7 +29,7 @@ export const useDarkWatchStore = create<DarkWatchState>()(
addWatchItem: async (item) => {
const newItem: WatchListItem = {
...item,
id: uuidv4(),
id: randomUUID(),
lastChecked: new Date().toISOString(),
};
set((state) => ({ watchList: [...state.watchList, newItem] }));
@@ -52,8 +52,10 @@ export const useDarkWatchStore = create<DarkWatchState>()(
refreshExposures: async () => {
set({ isLoading: true });
try {
// TODO: Wire to @shieldai/mobile-api-client for production
set({ isLoading: false });
} catch {
} catch (error) {
console.error('[DarkWatch] Failed to refresh exposures:', error);
set({ isLoading: false });
}
},

View File

@@ -1,7 +1,7 @@
import { create } from 'zustand';
import { persist, createJSONStorage } from 'zustand/middleware';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { v4 as uuidv4 } from 'uuid';
import { randomUUID } from 'expo-crypto';
import type { VoiceProfile, VoiceAnalysis } from '@/types';
/**
@@ -30,7 +30,7 @@ export const useVoicePrintStore = create<VoicePrintState>()(
addProfile: async (name: string, relationship: string) => {
const newProfile: VoiceProfile = {
id: uuidv4(),
id: randomUUID(),
name,
relationship,
enrolledAt: new Date().toISOString(),