Fixes issue where retrying on image upload fails (#166)

* Fixes issue where retrying on image upload fails

* Lint, longer test time

* Longer waitfor time in tests

* even longer timeout

* longer timeout

* missed file

* Update src/view/com/composer/ComposePost.tsx

Co-authored-by: Paul Frazee <pfrazee@gmail.com>

* Update src/view/com/composer/ComposePost.tsx

Co-authored-by: Paul Frazee <pfrazee@gmail.com>

---------

Co-authored-by: Paul Frazee <pfrazee@gmail.com>
This commit is contained in:
Aryan Goharzad
2023-02-07 13:38:22 -05:00
committed by GitHub
parent db9c8474bd
commit 2ac6cae63a
4 changed files with 12 additions and 4 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Yarn install
run: yarn
- name: Lint Reporter
@@ -30,7 +30,7 @@ jobs:
with:
node-version: 18
- name: Check out Git repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Yarn install
run: yarn
- name: Run tests
+4 -1
View File
@@ -1,6 +1,9 @@
/* global jest */
import {configure} from '@testing-library/react-native'
import 'react-native-gesture-handler/jestSetup'
configure({asyncUtilTimeout: 20000})
jest.mock('@react-native-async-storage/async-storage', () =>
require('@react-native-async-storage/async-storage/jest/async-storage-mock'),
)
+1 -1
View File
@@ -8,7 +8,7 @@
"web": "react-scripts start",
"start": "react-native start",
"clean-cache": "rm -rf node_modules/.cache/babel-loader/*",
"test": "jest --forceExit",
"test": "jest --forceExit --testTimeout=20000",
"test-watch": "jest --watchAll",
"test-ci": "jest --ci --forceExit --reporters=default --reporters=jest-junit",
"test-coverage": "jest --coverage",
+5
View File
@@ -275,6 +275,11 @@ export const ComposePost = observer(function ComposePost({
imageCount: selectedPhotos.length,
})
} catch (e: any) {
setExtLink({
...extLink,
isLoading: true,
localThumb: undefined,
} as apilib.ExternalEmbedDraft)
setError(cleanError(e.message))
setIsProcessing(false)
return