From 018270543a0123220c37b2adbace5f3da8f700dc Mon Sep 17 00:00:00 2001 From: Tim Glasgow Date: Sun, 24 Jul 2022 18:47:09 -0500 Subject: [PATCH] uuid dependency --- squarenotsquare/realm/migrations/Migrations.js | 5 +++-- squarenotsquare/realm/repos/ScoreRepo.js | 3 ++- squarenotsquare/realm/repos/SystemRepo.js | 5 +++-- squarenotsquare/realm/repos/UserRepo.js | 3 ++- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/squarenotsquare/realm/migrations/Migrations.js b/squarenotsquare/realm/migrations/Migrations.js index 4f875c7..0187e67 100644 --- a/squarenotsquare/realm/migrations/Migrations.js +++ b/squarenotsquare/realm/migrations/Migrations.js @@ -1,5 +1,6 @@ import {System} from '../entities/System'; -import uuid from 'uuid'; +import 'react-native-get-random-values'; +import { v4 as uuidv4 } from 'uuid'; export function migratev0(oldRealm, newRealm) { //start with empty db @@ -8,7 +9,7 @@ export function migratev0(oldRealm, newRealm) { export function migratev1(oldRealm, newRealm) { if (oldRealm.schemaVersion === 0) { newRealm.create(System.name, { - id: uuid.v4(), + id: uuidv4(), key: 'username', value: 'changeme' }); diff --git a/squarenotsquare/realm/repos/ScoreRepo.js b/squarenotsquare/realm/repos/ScoreRepo.js index 0bc770b..fae72dc 100644 --- a/squarenotsquare/realm/repos/ScoreRepo.js +++ b/squarenotsquare/realm/repos/ScoreRepo.js @@ -1,5 +1,6 @@ import {Score} from '../entities/Score'; -import uuid from 'uuid'; +import 'react-native-get-random-values'; +import { v4 as uuidv4 } from 'uuid'; export default class ScoreRepo { realmDB = null; diff --git a/squarenotsquare/realm/repos/SystemRepo.js b/squarenotsquare/realm/repos/SystemRepo.js index 2dd07fd..31a9f08 100644 --- a/squarenotsquare/realm/repos/SystemRepo.js +++ b/squarenotsquare/realm/repos/SystemRepo.js @@ -1,5 +1,6 @@ import {System} from '../entities/System'; -import uuid from 'uuid'; +import 'react-native-get-random-values'; +import { v4 as uuidv4 } from 'uuid'; export default class SystemRepo { realmDB = null; @@ -25,7 +26,7 @@ export default class SystemRepo { let existing = this.getSystemKeyValue(key); if (existing.id === null) { - sysID = uuid.v4(); + sysID = uuidv4(); } else { sysID = existing.id; } diff --git a/squarenotsquare/realm/repos/UserRepo.js b/squarenotsquare/realm/repos/UserRepo.js index 2a4fa9d..9892340 100644 --- a/squarenotsquare/realm/repos/UserRepo.js +++ b/squarenotsquare/realm/repos/UserRepo.js @@ -1,5 +1,6 @@ import {User} from '../entities/User'; -import uuid from 'uuid'; +import 'react-native-get-random-values'; +import { v4 as uuidv4 } from 'uuid'; export default class UserRepo { realmDB = null;