Skip to content

Commit

Permalink
Fix the instructions for “Adding Offline Support” (#817)
Browse files Browse the repository at this point in the history
A couple new files were missing from the written content.
  • Loading branch information
chasenlehara authored May 28, 2024
1 parent 8d891ef commit 30c15f5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/react-native/16-security-and-auth/security-and-auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ npm run start
✏️ Create **src/services/auth/AuthProvider.tsx** and update it to be:

@sourceref ../../../exercises/react-native/16-security/01-problem/src/services/auth/AuthProvider.tsx
@highlight 19, 27, only
@highlight 26, 31, 49, 54, 76, only

✏️ Create **src/services/auth/context.ts** and update it to be:

Expand Down
16 changes: 14 additions & 2 deletions src/react-native/17-offline-support/offline-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ If there was an issue with the API call (e.g. the server was down, the device wa

### Setup 2

✏️ Create **src/services/pmo/favorite/interfaces.ts** and update it to be:

@sourceref ../../../exercises/react-native/17-offline-support/02-problem/src/services/pmo/favorite/interfaces.ts
@highlight 1, 9, 15, 21, only

✏️ Create **src/services/pmo/favorite/hooks.ts** and update it to be:

@sourceref ../../../exercises/react-native/17-offline-support/02-problem/src/services/pmo/favorite/hooks.ts
Expand Down Expand Up @@ -203,7 +208,9 @@ In `RestaurantDetails`, add a button that uses the `toggleFavorite` helper:

### Solution 2

If you’ve implemented the solution correctly, the tests will pass when you run `npm run test`!
If you’ve implemented the solution correctly, you will be able to sign in and out of your Google account within the application!

You can test the error message by tapping “Sign in” and dismissing the modal.

<details>
<summary>Click to see the solution</summary>
Expand Down Expand Up @@ -243,7 +250,7 @@ Next, the Hook will send any favorites that were modified while the device was o
@sourceref ../../../exercises/react-native/17-offline-support/03-problem/src/services/pmo/favorite/sync.ts
@highlight 81-95, only

### Updating favorites modified on the device
### Updating storage with the changes

Last, the Hook will update Async Storage with all the changes that have accumulated through the sync process:

Expand All @@ -261,6 +268,11 @@ Last, the Hook will update Async Storage with all the changes that have accumula
@sourceref ../../../exercises/react-native/17-offline-support/03-problem/src/services/pmo/favorite/favorite.tsx
@highlight 9, only

✏️ Create **src/services/pmo/favorite/sync.ts** and update it to be:

@sourceref ../../../exercises/react-native/17-offline-support/03-problem/src/services/pmo/favorite/sync.ts
@highlight 11, only

✏️ Update **src/services/pmo/favorite/index.ts** to be:

@diff ../../../exercises/react-native/17-offline-support/02-solution/src/services/pmo/favorite/index.ts ../../../exercises/react-native/17-offline-support/03-solution/src/services/pmo/favorite/index.ts only
Expand Down
Binary file modified static/img/react-native/17-offline-support/01-solution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 30c15f5

Please sign in to comment.