From ed9a58355a3f50ae9d724ba0c1e46eb8ae0ad067 Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Thu, 4 Mar 2021 14:11:08 +0100 Subject: [PATCH] Fix details on timeline --- .github/workflows/development.yml | 1 + .github/workflows/staging.yml | 1 + fastlane/Fastfile | 2 +- src/Screens.tsx | 1 - src/components/Message.tsx | 2 +- src/components/Timeline.tsx | 4 ++-- src/components/Timeline/Footer.tsx | 4 +++- 7 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index 7b34286b..55fe10b3 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -46,5 +46,6 @@ jobs: ANDROID_KEYSTORE_ALIAS: ${{ secrets.ANDROID_KEYSTORE_ALIAS }} ANDROID_KEYSTORE_KEY_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_KEY_PASSWORD }} SUPPLY_JSON_KEY_DATA: ${{ secrets.SUPPLY_JSON_KEY_DATA }} + GH_PAT_GET_RELEASE: ${{ secrets.GH_PAT_GET_RELEASE }} FL_GITHUB_RELEASE_API_BEARER: ${{ secrets.GITHUB_TOKEN }} run: yarn app:build diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index f3f9a9eb..9925e39d 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -48,5 +48,6 @@ jobs: ANDROID_KEYSTORE_ALIAS: ${{ secrets.ANDROID_KEYSTORE_ALIAS }} ANDROID_KEYSTORE_KEY_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_KEY_PASSWORD }} SUPPLY_JSON_KEY_DATA: ${{ secrets.SUPPLY_JSON_KEY_DATA }} + GH_PAT_GET_RELEASE: ${{ secrets.GH_PAT_GET_RELEASE }} FL_GITHUB_RELEASE_API_BEARER: ${{ secrets.GITHUB_TOKEN }} run: yarn app:build diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 99dffb85..535ea4f0 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -143,7 +143,7 @@ private_lane :build_android do end lane :build do - releaseExists = get_github_release(url: GITHUB_REPO, version: GITHUB_RELEASE) + releaseExists = get_github_release(url: GITHUB_REPO, version: GITHUB_RELEASE, api_token: ENV['GH_PAT_GET_RELEASE']) if releaseExists puts("Release #{GITHUB_RELEASE} exists. Continue with building React Native only.") else diff --git a/src/Screens.tsx b/src/Screens.tsx index 68cb062b..b60e6288 100644 --- a/src/Screens.tsx +++ b/src/Screens.tsx @@ -85,7 +85,6 @@ const Screens: React.FC = ({ localCorrupt }) => { const showLocalCorrect = () => { if (localCorrupt) { displayMessage({ - autoHide: false, message: t('index.localCorrupt'), description: localCorrupt.length ? localCorrupt : undefined, type: 'error', diff --git a/src/components/Message.tsx b/src/components/Message.tsx index 22b93bfc..6717b12e 100644 --- a/src/components/Message.tsx +++ b/src/components/Message.tsx @@ -49,7 +49,7 @@ const displayMessage = ({ } showMessage({ - duration: duration === 'short' ? 1500 : 3000, + duration: type === 'error' ? 5000 : duration === 'short' ? 1500 : 3000, autoHide, message, description, diff --git a/src/components/Timeline.tsx b/src/components/Timeline.tsx index 2cf02347..546fae4e 100644 --- a/src/components/Timeline.tsx +++ b/src/components/Timeline.tsx @@ -58,8 +58,8 @@ const Timeline: React.FC = ({ ...queryKey[1], options: { notifyOnChangeProps: Platform.select({ - ios: ['data', 'isFetching'], - android: ['data', 'isFetching', 'isLoading'] + ios: ['dataUpdatedAt', 'isFetching'], + android: ['dataUpdatedAt', 'isFetching', 'isLoading'] }), getNextPageParam: lastPage => lastPage?.links?.next && { max_id: lastPage.links.next } diff --git a/src/components/Timeline/Footer.tsx b/src/components/Timeline/Footer.tsx index 7d2e6d38..cabfeb68 100644 --- a/src/components/Timeline/Footer.tsx +++ b/src/components/Timeline/Footer.tsx @@ -18,7 +18,9 @@ const TimelineFooter = React.memo( ...queryKey[1], options: { enabled: !disableInfinity, - notifyOnChangeProps: ['hasNextPage'] + notifyOnChangeProps: ['hasNextPage'], + getNextPageParam: lastPage => + lastPage?.links?.next && { max_id: lastPage.links.next } } })