refactor: replace nanoid with Math.random() for ID generation and remove the react-native-get-random-values dependency.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user