From b18ccc5490469f659746d5473a8060c64d819bd3 Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Mon, 6 Jun 2022 12:42:38 +0200 Subject: [PATCH 1/3] Fix badge not cleared on app launch --- package.json | 2 +- src/utils/push/useConnect.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 209e3464..4f4b11fb 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "native": "220508", "major": 4, "minor": 0, - "patch": 4, + "patch": 5, "expo": "45.0.0" }, "description": "tooot app for Mastodon", diff --git a/src/utils/push/useConnect.ts b/src/utils/push/useConnect.ts index 9b6453dd..e89b8610 100644 --- a/src/utils/push/useConnect.ts +++ b/src/utils/push/useConnect.ts @@ -78,7 +78,6 @@ const pushUseConnect = ({ t, instances }: Params) => { useEffect(() => { const appStateListener = AppState.addEventListener('change', state => { - console.log('changing state to', state) if (expoToken && pushEnabled.length && state === 'active') { Notifications.getBadgeCountAsync().then(count => { if (count > 0) { @@ -96,6 +95,7 @@ const pushUseConnect = ({ t, instances }: Params) => { return useEffect(() => { if (expoToken && pushEnabled.length) { + Notifications.setBadgeCountAsync(0) connect() } }, [expoToken, pushEnabled.length]) From 0cf7d0daf2a18455552fe1243e908329390f09e6 Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Mon, 6 Jun 2022 13:09:47 +0200 Subject: [PATCH 2/3] Update Expo workflow --- .github/workflows/build.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e9fc022b..58f21a0e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,10 +25,8 @@ jobs: distribution: 'zulu' java-version: '11' - name: -- Step 4 -- Use Expo action - uses: expo/expo-github-action@v6 + uses: expo/expo-github-action@v7 with: - expo-version: 5.x - username: ${{ secrets.EXPO_USERNAME }} token: ${{ secrets.EXPO_TOKEN }} - name: -- Step 5 -- Install node dependencies run: yarn install From baec474c5f5b0d80e562631f35391b0cdf6d4652 Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Mon, 6 Jun 2022 14:22:51 +0200 Subject: [PATCH 3/3] Update build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 58f21a0e..73628202 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,6 +27,7 @@ jobs: - name: -- Step 4 -- Use Expo action uses: expo/expo-github-action@v7 with: + expo-version: latest token: ${{ secrets.EXPO_TOKEN }} - name: -- Step 5 -- Install node dependencies run: yarn install