refactor: replace nanoid with Math.random() for ID generation and remove the react-native-get-random-values dependency.

This commit is contained in:
2026-03-18 10:25:58 +00:00
parent 1c68449e05
commit 13e0acd27d
4 changed files with 2 additions and 24 deletions

View File

@@ -7,7 +7,6 @@
import React, { createContext, useContext, useEffect, useMemo, useState } from 'react';
import { Appointment, Barber, BarberShop, CartItem, Order, Product, Service, User, WaitlistEntry, AppNotification } from '../types';
import { supabase } from '../lib/supabase';
import { nanoid } from 'nanoid';
import * as Notifications from 'expo-notifications';
import * as Device from 'expo-device';
import { Platform } from 'react-native';
@@ -218,7 +217,7 @@ export const AppProvider = ({ children }: { children: React.ReactNode }) => {
};
const register = (payload: any) => {
const id = nanoid();
const id = Math.random().toString(36).substring(2, 15);
const newUser: User = { ...payload, id };
setUser(newUser);
return newUser;
@@ -242,7 +241,7 @@ export const AppProvider = ({ children }: { children: React.ReactNode }) => {
}, 0);
const newOrder: Order = {
id: nanoid(),
id: Math.random().toString(36).substring(2, 15),
shopId,
customerId,
items: shopItems,