mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 12:39:17 +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}/>
|
onValueChange={actions.setPushSupported} trackColor={styles.track}/>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
||||||
<TouchableOpacity style={styles.media} activeOpacity={1}
|
{ state.transformSupported && (
|
||||||
onPress={() => actions.setPushSupported(!state.allowUnsealed)}>
|
<TouchableOpacity style={styles.media} activeOpacity={1}
|
||||||
<Text style={styles.modalLabel}>{ state.strings.allowUnsealed }</Text>
|
onPress={() => actions.setAllowUnsealed(!state.allowUnsealed)}>
|
||||||
<Switch style={styles.switch} value={state.allowUnsealed}
|
<Text style={styles.modalLabel}>{ state.strings.allowUnsealed }</Text>
|
||||||
onValueChange={actions.setAllowUnsealed} trackColor={styles.track}/>
|
<Switch style={styles.switch} value={state.allowUnsealed}
|
||||||
</TouchableOpacity>
|
onValueChange={actions.setAllowUnsealed} trackColor={styles.track}/>
|
||||||
|
</TouchableOpacity>
|
||||||
|
)}
|
||||||
|
|
||||||
<View style={styles.label}></View>
|
<View style={styles.label}></View>
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ export function useDashboard(config, server, token) {
|
|||||||
keyType: null,
|
keyType: null,
|
||||||
pushSupported: true,
|
pushSupported: true,
|
||||||
allowUnsealed: false,
|
allowUnsealed: false,
|
||||||
|
tranformSupported: false,
|
||||||
enableImage: true,
|
enableImage: true,
|
||||||
enableAudio: true,
|
enableAudio: true,
|
||||||
enableVideo: true,
|
enableVideo: true,
|
||||||
@ -66,8 +67,8 @@ export function useDashboard(config, server, token) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const { keyType, accountStorage, domain, enableImage, enableAudio, enableVideo, allowUnsealed, pushSupported, enableIce, iceUrl, iceUsername, icePassword } = config;
|
const { keyType, accountStorage, domain, enableImage, enableAudio, enableVideo, transformSupported, allowUnsealed, pushSupported, enableIce, iceUrl, iceUsername, icePassword } = config;
|
||||||
updateState({ keyType, storage: accountStorage.toString(), domain, enableImage, enableAudio, enableVideo, allowUnsealed, pushSupported, enableIce, iceUrl, iceUsername, icePassword });
|
updateState({ keyType, storage: accountStorage.toString(), domain, enableImage, enableAudio, enableVideo, transformSupported, allowUnsealed, pushSupported, enableIce, iceUrl, iceUsername, icePassword });
|
||||||
}, [config]);
|
}, [config]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -138,8 +139,8 @@ export function useDashboard(config, server, token) {
|
|||||||
updateState({ icePassword });
|
updateState({ icePassword });
|
||||||
},
|
},
|
||||||
saveConfig: async () => {
|
saveConfig: async () => {
|
||||||
const { storage, domain, keyType, enableImage, pushSupported, allowUnsealed, enableAudio, enableVideo, enableIce, iceUrl, iceUsername, icePassword } = state;
|
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, enableAudio, enableVideo, enableIce, iceUrl, iceUsername, icePassword };
|
const config = { accountStorage: Number(storage), domain, keyType, enableImage, pushSupported, allowUnsealed, transformSupported, enableAudio, enableVideo, enableIce, iceUrl, iceUsername, icePassword };
|
||||||
await setNodeConfig(server, token, config);
|
await setNodeConfig(server, token, config);
|
||||||
},
|
},
|
||||||
enableUser: async (accountId, enabled) => {
|
enableUser: async (accountId, enabled) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user