Skip to content

Commit aa6b9c2

Browse files
Merge pull request #440 from OpenDTU-App/419-add-the-ability-to-show-the-alerts-on-the-homescreen-again
2 parents 906d165 + 55b15a8 commit aa6b9c2

3 files changed

Lines changed: 23 additions & 2 deletions

File tree

src/slices/settings.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,10 @@ const settingsSlice = createSlice({
275275
setBugreportInfoDismissed: state => {
276276
state.bugreportInfoDismissed = true;
277277
},
278+
resetAllDismissedFlags: state => {
279+
state.feedbackInfoDismissed = false;
280+
state.bugreportInfoDismissed = false;
281+
},
278282
},
279283
});
280284

@@ -305,6 +309,7 @@ export const {
305309
setLastAppVersion,
306310
setFeedbackInfoDismissed,
307311
setBugreportInfoDismissed,
312+
resetAllDismissedFlags,
308313
} = settingsSlice.actions;
309314

310315
export const { reducer: SettingsReducer } = settingsSlice;

src/translations

src/views/navigation/screens/InformationGroup/AboutAppScreen.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { Linking, ScrollView, View } from 'react-native';
1818

1919
import moment from 'moment';
2020

21-
import { setEnableAppUpdates } from '@/slices/settings';
21+
import { resetAllDismissedFlags, setEnableAppUpdates } from '@/slices/settings';
2222

2323
import GenericRefreshModal from '@/components/modals/GenericRefreshModal';
2424
import OrientationContainer from '@/components/OrientationContainer';
@@ -81,6 +81,9 @@ const AboutAppScreen: FC<PropsWithNavigation> = ({ navigation }) => {
8181
setShowRefreshModal(false);
8282
}, []);
8383

84+
const [hasPressedResetDismissedFlags, setHasPressedResetDismissedFlags] =
85+
useState<boolean>(false);
86+
8487
return (
8588
<>
8689
<Appbar.Header>
@@ -213,6 +216,19 @@ const AboutAppScreen: FC<PropsWithNavigation> = ({ navigation }) => {
213216
opacity: !allowInAppUpdates ? 0.5 : 1,
214217
}}
215218
/>
219+
<Divider />
220+
<Box p={8}>
221+
<Button
222+
mode="contained-tonal"
223+
onPress={() => {
224+
dispatch(resetAllDismissedFlags());
225+
setHasPressedResetDismissedFlags(true);
226+
}}
227+
disabled={hasPressedResetDismissedFlags}
228+
>
229+
{t('aboutApp.showAlertsAgain')}
230+
</Button>
231+
</Box>
216232
</Surface>
217233
) : null}
218234
<View style={{ height: spacing * 2 }} />

0 commit comments

Comments
 (0)