Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Force upgrade] Fetch and parse app config #4862

Merged
merged 5 commits into from
Aug 17, 2022
Merged

Conversation

owencraston
Copy link
Contributor

@owencraston owencraston commented Aug 15, 2022

Description

Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions,
1. What is the reason for the change?

  • fetches minimum versions from https://metamask.github.io/metamask-mobile/AppConfig/v1/AppConfig.json
  • parses into useable typescript object
    2. What is the improvement/solution?
  • this will allow us to query the minimum versions from the main app and trigger the upgrade warning
  • adding the FetchState interfaces means we can reuse this same interface for any view that is waiting for a response from an api
  • this follows a similar pattern as MVVM

Testing

  • to test paste this code into a component
  const appConfig = useAppConfig();
  useEffect(() => {
    if (appConfig.type === 'Success') {
      console.log('app config response', appConfig.data);
    } else {
      console.log({ appConfig });
    }
  });

Screenshots/Recordings
This is what is hosted on the site
Screen Shot 2022-08-15 at 2 04 19 PM

temporarily logged the response in the app/components/Nav/App/index.js file and got sane values back
Screen Shot 2022-08-15 at 1 53 11 PM

Issue

Progresses #4811

Checklist

  • There is a related GitHub issue
  • Tests are included if applicable
  • Any added code is fully documented

@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@owencraston owencraston marked this pull request as ready for review August 15, 2022 21:05
@owencraston owencraston requested a review from a team as a code owner August 15, 2022 21:05
Copy link
Contributor

@sethkfman sethkfman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@gantunesr gantunesr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@owencraston owencraston merged commit 2cae4db into main Aug 17, 2022
@owencraston owencraston deleted the fetch-minimum-versions branch August 17, 2022 20:10
@github-actions github-actions bot locked and limited conversation to collaborators Aug 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants