Skip to content

Commit

Permalink
fix(apps/mobile): fix TypeScript type issues when dispatching thunks
Browse files Browse the repository at this point in the history
  • Loading branch information
hassankhan committed Oct 13, 2024
1 parent 6ff123f commit 2aa0da8
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export const ImageSourceButton = ({ source }: InteractiveImageSourceProps) => {
const icon = source === 'camera' ? 'camera' : 'images';

const handleSelectAndUpload = useCallback(async () => {
// @ts-expect-error Thunk does not need any parameters
const response = await dispatch(thunk()).unwrap();

// The user cancelled the picker
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/src/store/overrides.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export const createAppAsyncThunk = createAsyncThunk.withTypes<{
state: RootState;
dispatch: AppDispatch;
rejectValue: string;
extra: { s: string; n: number };
// extra: { s: string; n: number };
}>();
1 change: 0 additions & 1 deletion apps/mobile/src/store/thunks/launchNativeCamera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { requestCameraPermission } from './requestCameraPermission';
export const launchNativeCamera = createAppAsyncThunk(
'photos/launchNativeCamera',
async (_, { dispatch }) => {
// @ts-expect-error Thunk does not need any parameters
await dispatch(requestCameraPermission());

return ImagePicker.launchCameraAsync({
Expand Down
1 change: 0 additions & 1 deletion apps/mobile/src/store/thunks/launchNativePhotoPicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { requestPhotoLibraryPermission } from './requestPhotoLibraryPermission';
export const launchNativePhotoPicker = createAppAsyncThunk(
'photos/launchNativePhotoPicker',
async (_, { dispatch }) => {
// @ts-expect-error Thunk does not need any parameters
await dispatch(requestPhotoLibraryPermission());

return ImagePicker.launchImageLibraryAsync({
Expand Down

0 comments on commit 2aa0da8

Please sign in to comment.