A bug was created during the course of the app development. Every time you return to the main view, it fetches and reloads the table. In some cases, the file may not have been uploaded at that point and it goes missing. You need to only load the table at certain times and not when view displays. Move that as part of the fix in this video.
- [Instructor] So, we have a bug in the app.…Whenever we add a new image, it's there for just a second…and then it disappears.…We can add another one, and the same thing will happen.…And this is because whenever viewWillAppear is called,…it's refreshing the list.…And the first thing it does is empty the list,…then it has to go fetch the images again from the server.…So we need to change that.…Back in the code where we're calling checkSignIn,…we need to do this only once per execution of the app.…And a great place to do that is in viewDidLoad.…
So at the bottom of viewDidLoad, we'll call checkSignIn,…and now it'll only be done once per execution.…And if the user is already signed in,…it'll reload the table, fetching from the server,…otherwise, when we come back from another view,…it won't checkSignIn and it won't refresh.…This'll also save us some performance…from hitting the server,…and any data it uses also will be saved…for not hitting the server and slowing the user down.…So let's run the app again.…And make sure that when we add new items,…
Author
Released
1/8/2019- Working with the Amplify toolchain
- Creating a React app
- Adding analytics to a React app with Amplify
- User authentication via AWS
- Using Amplify to simplify account creation and management
- Creating a GraphQL API
- Storing files online
Skill Level Intermediate
Duration
Views
Related Courses
-
AWS API Gateway with HTTP, Lambda, DynamoDB, and iOS
with Bear Cahill1h 33m Intermediate -
AWS Security Best Practices for Developers
with Carlos Rivas46m 31s Intermediate
-
Introduction
-
1. AWS Amplify Overview
-
Introduction to Amplify4m 13s
-
Amplify principles2m 59s
-
Amplify toolchain2m 47s
-
-
2. Amplified React App
-
Analytics added with Amplify4m 47s
-
App hosting in S32m 38s
-
User authentication via AWS4m 45s
-
Lambdas created2m 30s
-
3. Mobile App Features
-
AWS CocoaPods2m 13s
-
Account management1m 11s
-
4. Serverless Back End
-
GraphQL API5m 28s
-
Mobile app and AppSync4m 42s
-
Store online function4m 54s
-
Save data to the server3m 35s
-
Fetch items from the server4m 52s
-
-
5. Storing Files Online
-
File storage configuration2m 19s
-
Downloading files4m 47s
-
Delete items from AWS1m 30s
-
Delete files from a bucket4m 35s
-
Debugging1m 13s
-
Billing and clean up2m 32s
-
-
Conclusion
-
Next steps42s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Debugging