Browse Source

Merge branch 'fix/updatetask-nav' of gitlab.com:jetup/rws/rws-appication

merge-requests/234/head
Vitalik 3 years ago
parent
commit
b7fbf6dc6c
  1. 20
      ios/Podfile.lock
  2. 4
      ios/taskme.xcodeproj/project.pbxproj
  3. 17
      src/modules/tasks/hooks/use-create-update-task.hook.ts

20
ios/Podfile.lock

@ -574,8 +574,8 @@ SPEC CHECKSUMS: @@ -574,8 +574,8 @@ SPEC CHECKSUMS:
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
OneSignalXCFramework: 10648e60ff3d335fbffa62d9b44b700b56d49b51
OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b
Permission-Camera: 9eb618fd601ae4a674b072c3b0d37f109d7b91e5
Permission-PhotoLibrary: 900e7e33012bd5e02e5859cb65d5bb2134259c64
Permission-Camera: 53efcbb755b0e8bdf253dbb27cc7559ccfce8480
Permission-PhotoLibrary: 7bec836dcdd04a0bfb200c314f1aae06d4476357
RCT-Folly: ec7a233ccc97cc556cf7237f0db1ff65b986f27c
RCTRequired: d34bf57e17cb6e3b2681f4809b13843c021feb6c
RCTTypeSafety: 8dab4933124ed39bb0c1d88d74d61b1eb950f28f
@ -589,12 +589,12 @@ SPEC CHECKSUMS: @@ -589,12 +589,12 @@ SPEC CHECKSUMS:
React-jsinspector: 34e23860273a23695342f58eed3ffd3ba10c31e0
react-native-clear-cache: 28bce59b33cd809e0afe903786787b4409d1c1fb
react-native-date-picker: 201b481c94dcb7678f4712477ad026dd7793305b
react-native-image-picker: 27c3726557dac6e224a17c564c16cdc7fb952f79
react-native-netinfo: 877946c7b4eb85a639cf1ea31333dadc2be999a1
react-native-onesignal: 9afcdc24aa4557ed58a92803695382b0fe8ea6e7
react-native-image-picker: 5fe0a96bef4935bbdfb02f59b910bf40d5526109
react-native-netinfo: 3d3769f0d65de15c83a9bf1346f8be71de5a24bf
react-native-onesignal: 6ce91b6cb91e6e2b9caf051da82a27573bf9950c
react-native-orientation-locker: 998c0744e26624407dac068c04c605b4af7304a2
react-native-pager-view: f21658a2e12eced35ef998250375e4e4dc9b8487
react-native-safe-area-context: 8465df05de8106c584b117f0e027e17174d6e02e
react-native-pager-view: 5ab4d0b4b44d89f77310cb3eb8129745f274ce55
react-native-safe-area-context: 61c8c484a3a9e7d1fda19f7b1794b35bbfd2262a
react-native-splash-screen: 200d11d188e2e78cea3ad319964f6142b6384865
React-perflogger: cc76a4254d19640f1d8ad1c66fdee800414b805c
React-RCTActionSheet: 7448f049318d8d7e8a9a1ebb742ada721757eea8
@ -608,12 +608,12 @@ SPEC CHECKSUMS: @@ -608,12 +608,12 @@ SPEC CHECKSUMS:
React-RCTVibration: c7f845861e79eae13dc1e8217a3cf47a3945b504
React-runtimeexecutor: 493d9abb8b23c3f84e19ae221eeba92cadcb70dc
ReactCommon: 8fea6422328e2fc093e25c9fac67adbcf0f04fb4
RNCAsyncStorage: 0f655864a81214d1c5a9bf0faf79d86dc25c383e
RNCAsyncStorage: e8b8d6320a0dd90eb610fb0d0b1ef90596697c69
RNCPicker: c3a3d481bec16624ed84a3c2a64c92fdc5515960
RNDeviceInfo: 0d6865ab0a57d9192bdd4e4f5894340b846c3e53
RNDeviceInfo: cc7de0772378f85d8f36ae439df20f05c590a651
RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211
RNImageCropPicker: 448d3c6e923fde3466b49caf3c2457c2a0ba02dd
RNPermissions: bf844d392fe0ecbfbd2e4ae2b88cc32f2f09b369
RNPermissions: f7ebe52db07c00901127966ca080b4ec6a6ceb0a
RNScreens: eb0dfb2d6b21d2d7f980ad46b14eb306d2f1062e
RNSVG: 8ba35cbeb385a52fd960fd28db9d7d18b4c2974f
RNVectorIcons: f67a1abce2ec73e62fe4606e8110e95a832bc859

4
ios/taskme.xcodeproj/project.pbxproj

@ -653,7 +653,7 @@ @@ -653,7 +653,7 @@
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
@ -718,7 +718,7 @@ @@ -718,7 +718,7 @@
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;

17
src/modules/tasks/hooks/use-create-update-task.hook.ts

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
import { navigation } from './../../../shared/themes/dark/navigation';
import { RouteKey } from './../../../shared/enums/route-key.enum';
import { StackNavigationProp } from '@react-navigation/stack';
import { useNavigation } from '@react-navigation/native';
import { navigation } from './../../../shared/themes/dark/navigation'
import { RouteKey } from './../../../shared/enums/route-key.enum'
import { StackNavigationProp } from '@react-navigation/stack'
import { useNavigation } from '@react-navigation/native'
import { useSelector } from 'react-redux'
import { tasksService } from '@/services/domain'
import { appEvents, getMessageByExceptionKey, useForm } from '@/shared'
@ -15,7 +15,7 @@ import { ICreateUpdateTaskValues } from '../interfaces' @@ -15,7 +15,7 @@ import { ICreateUpdateTaskValues } from '../interfaces'
import { getErrorCode, getMessageByErrorCode } from '@/shared/helpers'
import moment from 'moment'
type TNav = StackNavigationProp<{[RouteKey.Home]}>
type TNav = StackNavigationProp<{ [RouteKey.Home] }>
const initialValues: ICreateUpdateTaskValues = {
reasonId: '',
@ -32,7 +32,7 @@ export const useCreateUpdateTask = (mode: TaskEditMode, taskId?: number) => { @@ -32,7 +32,7 @@ export const useCreateUpdateTask = (mode: TaskEditMode, taskId?: number) => {
const [isLoading, setLoading] = useState<boolean>(false)
const [error, setError] = useState<CreatingTaskErrors | string>(null)
const nav = useNavigation<TNav>()
const nav = useNavigation<TNav>()
const taskRequests: Record<TaskEditMode, any> = {
[TaskEditMode.Create]: tasksService.create,
@ -96,7 +96,10 @@ export const useCreateUpdateTask = (mode: TaskEditMode, taskId?: number) => { @@ -96,7 +96,10 @@ export const useCreateUpdateTask = (mode: TaskEditMode, taskId?: number) => {
? 'Зміни збережено'
: 'Задачу створено',
message: '',
onPressOk: () => nav.navigate(RouteKey.Home),
onPressOk:
mode === TaskEditMode.Update
? () => nav.goBack()
: () => nav.navigate(RouteKey.Home),
})
}

Loading…
Cancel
Save