Merge branch 'Bug-android-back-button-when-navigating-away-from-settings' into 'rebased-redesign'
Fix error occurring when navigating back from settings section See merge request bloodyhealth/drip!319
This commit is contained in:
+2
-10
@@ -7,23 +7,15 @@ const navigationSlice = createSlice({
|
||||
currentPage: 'Home',
|
||||
},
|
||||
reducers: {
|
||||
navigate: (state, action) => {
|
||||
navigate: (_state, action) => {
|
||||
return {
|
||||
currentPage: action.payload,
|
||||
previousPage: state.currentPage,
|
||||
}
|
||||
},
|
||||
goBack: ({ currentPage, previousPage }) => {
|
||||
if (currentPage === 'CycleDay' && !!previousPage) {
|
||||
return {
|
||||
currentPage: previousPage,
|
||||
}
|
||||
}
|
||||
|
||||
goBack: ({ currentPage }) => {
|
||||
const page = pages.find((p) => p.component === currentPage)
|
||||
return {
|
||||
currentPage: page.parent,
|
||||
previousPage: currentPage,
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user