mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 12:39:17 +00:00
supporting global notification setting
This commit is contained in:
parent
8f4c15d5da
commit
ae0ea4724c
@ -183,6 +183,14 @@ export function Dashboard(props) {
|
||||
<Text style={styles.option}>RSA 4096</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
|
||||
<TouchableOpacity style={styles.media} activeOpacity={1}
|
||||
onPress={() => actions.setPushSupported(!state.pushSupported)}>
|
||||
<Text style={styles.modalLabel}>Enable Push Notifications: </Text>
|
||||
<Switch style={styles.switch} value={state.pushSupported}
|
||||
onValueChange={actions.setPushSupported} trackColor={styles.track}/>
|
||||
</TouchableOpacity>
|
||||
|
||||
<TouchableOpacity style={styles.media} activeOpacity={1}
|
||||
onPress={() => actions.setEnableImage(!state.enableImage)}>
|
||||
<Text style={styles.modalLabel}>Enable Image Queue: </Text>
|
||||
|
@ -96,6 +96,9 @@ export function useDashboard(config, server, token) {
|
||||
setStorage: (storage) => {
|
||||
updateState({ storage: Number(storage.replace(/[^0-9]/g, '')) });
|
||||
},
|
||||
setPushSupported: (pushSupported) => {
|
||||
updateState({ pushSupported });
|
||||
},
|
||||
setEnableImage: (enableImage) => {
|
||||
updateState({ enableImage });
|
||||
},
|
||||
|
@ -3566,6 +3566,8 @@ components:
|
||||
type: boolean
|
||||
keyType:
|
||||
type: string
|
||||
pushSupported:
|
||||
type: boolean
|
||||
|
||||
AccountStatus:
|
||||
type: object
|
||||
|
@ -21,6 +21,7 @@ func GetNodeConfig(w http.ResponseWriter, r *http.Request) {
|
||||
config.EnableAudio = getBoolConfigValue(CNFEnableAudio, true)
|
||||
config.EnableVideo = getBoolConfigValue(CNFEnableVideo, true)
|
||||
config.KeyType = getStrConfigValue(CNFKeyType, APPRSA4096)
|
||||
config.PushSupported = getBoolConfigValue(CNFPushSupported, true)
|
||||
|
||||
WriteResponse(w, config)
|
||||
}
|
||||
|
@ -66,6 +66,14 @@ func SetNodeConfig(w http.ResponseWriter, r *http.Request) {
|
||||
return res
|
||||
}
|
||||
|
||||
// upsert push supported
|
||||
if res := tx.Clauses(clause.OnConflict{
|
||||
Columns: []clause.Column{{Name: "config_id"}},
|
||||
DoUpdates: clause.AssignmentColumns([]string{"bool_value"}),
|
||||
}).Create(&store.Config{ConfigID: CNFPushSupported, BoolValue: config.PushSupported}).Error; res != nil {
|
||||
return res
|
||||
}
|
||||
|
||||
// upsert key type
|
||||
if res := tx.Clauses(clause.OnConflict{
|
||||
Columns: []clause.Column{{Name: "config_id"}},
|
||||
|
@ -347,6 +347,8 @@ type NodeConfig struct {
|
||||
KeyType string `json:"keyType"`
|
||||
|
||||
AccountStorage int64 `json:"accountStorage"`
|
||||
|
||||
PushSupported bool `json:"pushSupported"`
|
||||
}
|
||||
|
||||
//Profile public attributes of account
|
||||
|
Loading…
Reference in New Issue
Block a user