Skip to content

Commit

Permalink
fix: Fix Persistance
Browse files Browse the repository at this point in the history
Fixed Persistance App layer
Fixed iOS Build Action
  • Loading branch information
Alex Risch authored and Alex Risch committed May 28, 2024
1 parent b9d4909 commit 1fd333d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 6 additions & 1 deletion src/providers/QueryClientProvider.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -17,13 +18,17 @@ const mmkvStoragePersister = createSyncStoragePersister({
mmkvstorage.delete(key);
},
},
serialize: stringify,
deserialize: parse,
});

export const QueryClientProvider: FC<PropsWithChildren> = ({children}) => {
return (
<PersistQueryClientProvider
client={queryClient}
persistOptions={{persister: mmkvStoragePersister}}>
persistOptions={{
persister: mmkvStoragePersister,
}}>
{children}
</PersistQueryClientProvider>
);
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 1fd333d

Please sign in to comment.