fix: confirm dialog before clearing WebDAV config, ensure full button text

This commit is contained in:
Eddy de Vink 2026-06-27 23:56:57 +02:00
commit ea29f52fad

View file

@ -48,12 +48,24 @@ export default function SettingsScreen() {
Alert.alert('Opgeslagen', 'WebDAV instellingen zijn opgeslagen') Alert.alert('Opgeslagen', 'WebDAV instellingen zijn opgeslagen')
} }
const handleClear = async () => { const handleClear = () => {
Alert.alert(
'Instellingen wissen?',
'WebDAV configuratie definitief verwijderen? Je kunt deze later opnieuw invoeren.',
[
{ text: 'Annuleren', style: 'cancel' },
{
text: 'Ja, wissen',
style: 'destructive',
onPress: async () => {
await deleteConfig() await deleteConfig()
setUrl('') setUrl('')
setUsername('') setUsername('')
setPassword('') setPassword('')
Alert.alert('Verwijderd', 'WebDAV instellingen zijn gewist') },
},
]
)
} }
const handleSync = async () => { const handleSync = async () => {
@ -111,7 +123,7 @@ export default function SettingsScreen() {
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity style={styles.clearButton} onPress={handleClear}> <TouchableOpacity style={styles.clearButton} onPress={handleClear}>
<Text style={styles.clearButtonText}>Instellingen wissen</Text> <Text style={styles.clearButtonText} numberOfLines={1}>Instellingen wissen</Text>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity <TouchableOpacity
@ -136,7 +148,7 @@ const styles = StyleSheet.create({
eyeButton: { padding: 12 }, eyeButton: { padding: 12 },
eyeIcon: { fontSize: 20 }, eyeIcon: { fontSize: 20 },
saveButton: { backgroundColor: '#4CAF50', padding: 14, borderRadius: 8, alignItems: 'center', marginTop: 24 }, saveButton: { backgroundColor: '#4CAF50', padding: 14, borderRadius: 8, alignItems: 'center', marginTop: 24 },
clearButton: { padding: 14, alignItems: 'center', marginTop: 8 }, clearButton: { padding: 14, borderRadius: 8, alignItems: 'center', alignSelf: 'stretch', marginTop: 8 },
clearButtonText: { color: '#e53935', fontSize: 14 }, clearButtonText: { color: '#e53935', fontSize: 14 },
syncButton: { backgroundColor: '#2196F3', padding: 14, borderRadius: 8, alignItems: 'center', marginTop: 24 }, syncButton: { backgroundColor: '#2196F3', padding: 14, borderRadius: 8, alignItems: 'center', marginTop: 24 },
syncButtonDisabled: { opacity: 0.6 }, syncButtonDisabled: { opacity: 0.6 },