mirror of
https://github.com/balzack/databag.git
synced 2025-02-11 19:19:16 +00:00
showing allow unsealed only if transforms are available
This commit is contained in:
parent
25e469a639
commit
c4f33da48a
@ -191,12 +191,14 @@ export function Dashboard(props) {
|
||||
onValueChange={actions.setPushSupported} trackColor={styles.track}/>
|
||||
</TouchableOpacity>
|
||||
|
||||
<TouchableOpacity style={styles.media} activeOpacity={1}
|
||||
onPress={() => actions.setPushSupported(!state.allowUnsealed)}>
|
||||
<Text style={styles.modalLabel}>{ state.strings.allowUnsealed }</Text>
|
||||
<Switch style={styles.switch} value={state.allowUnsealed}
|
||||
onValueChange={actions.setAllowUnsealed} trackColor={styles.track}/>
|
||||
</TouchableOpacity>
|
||||
{ state.transformSupported && (
|
||||
<TouchableOpacity style={styles.media} activeOpacity={1}
|
||||
onPress={() => actions.setAllowUnsealed(!state.allowUnsealed)}>
|
||||
<Text style={styles.modalLabel}>{ state.strings.allowUnsealed }</Text>
|
||||
<Switch style={styles.switch} value={state.allowUnsealed}
|
||||
onValueChange={actions.setAllowUnsealed} trackColor={styles.track}/>
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
|
||||
<View style={styles.label}></View>
|
||||
|
||||
|
@ -30,6 +30,7 @@ export function useDashboard(config, server, token) {
|
||||
keyType: null,
|
||||
pushSupported: true,
|
||||
allowUnsealed: false,
|
||||
tranformSupported: false,
|
||||
enableImage: true,
|
||||
enableAudio: true,
|
||||
enableVideo: true,
|
||||
@ -66,8 +67,8 @@ export function useDashboard(config, server, token) {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const { keyType, accountStorage, domain, enableImage, enableAudio, enableVideo, allowUnsealed, pushSupported, enableIce, iceUrl, iceUsername, icePassword } = config;
|
||||
updateState({ keyType, storage: accountStorage.toString(), domain, enableImage, enableAudio, enableVideo, allowUnsealed, pushSupported, enableIce, iceUrl, iceUsername, icePassword });
|
||||
const { keyType, accountStorage, domain, enableImage, enableAudio, enableVideo, transformSupported, allowUnsealed, pushSupported, enableIce, iceUrl, iceUsername, icePassword } = config;
|
||||
updateState({ keyType, storage: accountStorage.toString(), domain, enableImage, enableAudio, enableVideo, transformSupported, allowUnsealed, pushSupported, enableIce, iceUrl, iceUsername, icePassword });
|
||||
}, [config]);
|
||||
|
||||
useEffect(() => {
|
||||
@ -138,8 +139,8 @@ export function useDashboard(config, server, token) {
|
||||
updateState({ icePassword });
|
||||
},
|
||||
saveConfig: async () => {
|
||||
const { storage, domain, keyType, enableImage, pushSupported, allowUnsealed, enableAudio, enableVideo, enableIce, iceUrl, iceUsername, icePassword } = state;
|
||||
const config = { accountStorage: Number(storage), domain, keyType, enableImage, pushSupported, allowUnsealed, enableAudio, enableVideo, enableIce, iceUrl, iceUsername, icePassword };
|
||||
const { storage, domain, keyType, enableImage, pushSupported, allowUnsealed, transformSupported, enableAudio, enableVideo, enableIce, iceUrl, iceUsername, icePassword } = state;
|
||||
const config = { accountStorage: Number(storage), domain, keyType, enableImage, pushSupported, allowUnsealed, transformSupported, enableAudio, enableVideo, enableIce, iceUrl, iceUsername, icePassword };
|
||||
await setNodeConfig(server, token, config);
|
||||
},
|
||||
enableUser: async (accountId, enabled) => {
|
||||
|
Loading…
Reference in New Issue
Block a user