Skip to content

Commit

Permalink
Merge branch 'main' into fdroid
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandosborne committed May 24, 2024
2 parents 841c410 + 2804de9 commit 4e8710a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 27 deletions.
56 changes: 31 additions & 25 deletions app/mobile/src/session/settings/Settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,18 +224,20 @@ export function Settings({ drawer }) {
</View>
</TouchableOpacity>

<TouchableOpacity style={styles.drawerEntry} activeOpacity={1}>
<View style={styles.icon}>
<MatIcons name="ticket-confirmation-outline" size={20} color={Colors.text} />
</View>
<View style={styles.optionControl}>
<TouchableOpacity activeOpacity={1} onPress={actions.toggleMFA}>
<Text style={styles.optionText}>{ state.strings.mfaTitle }</Text>
</TouchableOpacity>
<Switch value={state.mfaEnabled} style={Platform.OS==='ios' ? styles.notifications : {}} thumbColor={Colors.sliderGrip} ios_backgroundColor={Colors.idleFill}
trackColor={styles.track} onValueChange={toggleMFA} />
</View>
</TouchableOpacity>
{ state.mfaEnabled != null && (
<TouchableOpacity style={styles.drawerEntry} activeOpacity={1}>
<View style={styles.icon}>
<MatIcons name="ticket-confirmation-outline" size={20} color={Colors.text} />
</View>
<View style={styles.optionControl}>
<TouchableOpacity activeOpacity={1} onPress={actions.toggleMFA}>
<Text style={styles.optionText}>{ state.strings.mfaTitle }</Text>
</TouchableOpacity>
<Switch value={state.mfaEnabled} style={Platform.OS==='ios' ? styles.notifications : {}} thumbColor={Colors.sliderGrip} ios_backgroundColor={Colors.idleFill}
trackColor={styles.track} onValueChange={toggleMFA} />
</View>
</TouchableOpacity>
)}

<TouchableOpacity style={styles.drawerEntry} activeOpacity={1} onPress={actions.showLogin}>
<View style={styles.icon}>
Expand Down Expand Up @@ -391,19 +393,23 @@ export function Settings({ drawer }) {
<Text style={styles.optionLink}>{ state.strings.logout }</Text>
</View>
</TouchableOpacity>
<View style={styles.divider} />
<TouchableOpacity style={styles.entry} activeOpacity={1}>
<View style={styles.icon}>
<MatIcons name="ticket-confirmation-outline" size={20} color={Colors.linkText} />
</View>
<View style={styles.optionControl}>
<TouchableOpacity activeOpacity={1} onPress={toggleMFA}>
<Text style={styles.optionLink}>{ state.strings.mfaTitle }</Text>
</TouchableOpacity>
<Switch value={state.mfaEnabled} style={Platform.OS==='ios' ? styles.notifications : {}} thumbColor={Colors.sliderGrip} ios_backgroundColor={Colors.disabledIndicator}
trackColor={styles.track} onValueChange={toggleMFA} />
</View>
</TouchableOpacity>
{ state.mfaEnabled != null && (
<View style={styles.divider} />
)}
{ state.mfaEnabled != null && (
<TouchableOpacity style={styles.entry} activeOpacity={1}>
<View style={styles.icon}>
<MatIcons name="ticket-confirmation-outline" size={20} color={Colors.linkText} />
</View>
<View style={styles.optionControl}>
<TouchableOpacity activeOpacity={1} onPress={toggleMFA}>
<Text style={styles.optionLink}>{ state.strings.mfaTitle }</Text>
</TouchableOpacity>
<Switch value={state.mfaEnabled} style={Platform.OS==='ios' ? styles.notifications : {}} thumbColor={Colors.sliderGrip} ios_backgroundColor={Colors.disabledIndicator}
trackColor={styles.track} onValueChange={toggleMFA} />
</View>
</TouchableOpacity>
)}
<View style={styles.divider} />
<TouchableOpacity style={styles.entry} activeOpacity={1} onPress={actions.showLogin}>
<View style={styles.icon}>
Expand Down
2 changes: 1 addition & 1 deletion net/server/internal/api_setAdminAccess.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func SetAdminAccess(w http.ResponseWriter, r *http.Request) {
if res := tx.Clauses(clause.OnConflict{
Columns: []clause.Column{{Name: "config_id"}},
DoUpdates: clause.AssignmentColumns([]string{"num_value"}),
}).Create(&store.Config{ConfigID: CNFMFAFailedCount, NumValue: failedCount + 1}).Error; res != nil {
}).Create(&store.Config{ConfigID: CNFMFAFailedCount, NumValue: 1}).Error; res != nil {
return res
}
}
Expand Down
2 changes: 1 addition & 1 deletion net/server/internal/api_setAdminMFAuth.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func SetAdminMFAuth(w http.ResponseWriter, r *http.Request) {
if res := tx.Clauses(clause.OnConflict{
Columns: []clause.Column{{Name: "config_id"}},
DoUpdates: clause.AssignmentColumns([]string{"num_value"}),
}).Create(&store.Config{ConfigID: CNFMFAFailedCount, NumValue: failedCount + 1}).Error; res != nil {
}).Create(&store.Config{ConfigID: CNFMFAFailedCount, NumValue: 1}).Error; res != nil {
return res
}
}
Expand Down

0 comments on commit 4e8710a

Please sign in to comment.