From 1fd333d8bec37425f4625e44afd4661b0188af1d Mon Sep 17 00:00:00 2001 From: Alex Risch Date: Tue, 28 May 2024 16:20:59 -0600 Subject: [PATCH] fix: Fix Persistance Fixed Persistance App layer Fixed iOS Build Action --- .github/workflows/ios.yml | 2 +- package.json | 1 + src/providers/QueryClientProvider.tsx | 7 ++++++- yarn.lock | 5 +++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index c26cacd..ff32b9b 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -20,4 +20,4 @@ jobs: - run: bundle exec yarn - run: bundle exec pod install --project-directory=ios - name: Build iOS App - run: yarn ios --no-packager --mode Release + run: cd ios && xcodebuild -workspace EphemeraMobileChat.xcworkspace -scheme EphemeraMobileChat -configuration Release -sdk iphoneos build diff --git a/package.json b/package.json index b8df16e..a64f7bd 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "aws-sdk": "^2.1540.0", "ethers": "^5", "expo": ">=50.0.0-0 <51.0.0", + "flatted": "^3.3.1", "i18n-js": "^4.3.2", "native-base": "^3.4.28", "node-libs-browser": "^2.2.1", diff --git a/src/providers/QueryClientProvider.tsx b/src/providers/QueryClientProvider.tsx index 2dce8fd..164ff3e 100644 --- a/src/providers/QueryClientProvider.tsx +++ b/src/providers/QueryClientProvider.tsx @@ -1,5 +1,6 @@ import {createSyncStoragePersister} from '@tanstack/query-sync-storage-persister'; import {PersistQueryClientProvider} from '@tanstack/react-query-persist-client'; +import {parse, stringify} from 'flatted'; // A library to handle cyclical structures import React, {FC, PropsWithChildren} from 'react'; import {mmkvstorage} from '../services/mmkvStorage'; import {queryClient} from '../services/queryClient'; @@ -17,13 +18,17 @@ const mmkvStoragePersister = createSyncStoragePersister({ mmkvstorage.delete(key); }, }, + serialize: stringify, + deserialize: parse, }); export const QueryClientProvider: FC = ({children}) => { return ( + persistOptions={{ + persister: mmkvStoragePersister, + }}> {children} ); diff --git a/yarn.lock b/yarn.lock index 85dee79..f2d18d2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12853,6 +12853,11 @@ flatted@^3.2.9: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf" integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ== +flatted@^3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.1.tgz#21db470729a6734d4997002f439cb308987f567a" + integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw== + flow-enums-runtime@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/flow-enums-runtime/-/flow-enums-runtime-0.0.6.tgz#5bb0cd1b0a3e471330f4d109039b7eba5cb3e787"