mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 12:39:17 +00:00
adding global push notification support to browser
This commit is contained in:
parent
ae0ea4724c
commit
b8d627e2ec
@ -105,6 +105,11 @@ export function Dashboard({ token, config, logout }) {
|
||||
<Select.Option value="RSA4096">RSA 4096</Select.Option>
|
||||
</Select>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div>Enable Push Notification: </div>
|
||||
<Switch onChange={(e) => actions.setPushSupported(e)} size="small"
|
||||
defaultChecked={true} checked={state.pushSupported} />
|
||||
</div>
|
||||
<div class="field">
|
||||
<div>Enable Image Queue: </div>
|
||||
<Switch onChange={(e) => actions.setEnableImage(e)} size="small"
|
||||
|
@ -11,6 +11,7 @@ export function useDashboard(token, config) {
|
||||
domain: "",
|
||||
accountStorage: null,
|
||||
keyType: null,
|
||||
pushSupported: null,
|
||||
enableImage: null,
|
||||
enableAudio: null,
|
||||
enableVideo: null,
|
||||
@ -58,6 +59,9 @@ export function useDashboard(token, config) {
|
||||
setKeyType: (keyType) => {
|
||||
updateState({ keyType });
|
||||
},
|
||||
setPushSupported: (pushSupported) => {
|
||||
updateState({ pushSupported });
|
||||
},
|
||||
setEnableImage: (enableImage) => {
|
||||
updateState({ enableImage });
|
||||
},
|
||||
@ -74,10 +78,10 @@ export function useDashboard(token, config) {
|
||||
if (!state.busy) {
|
||||
updateState({ busy: true });
|
||||
try {
|
||||
const { domain, keyType, accountStorage, enableImage, enableAudio, enableVideo } = state;
|
||||
const { domain, keyType, accountStorage, pushSupported, enableImage, enableAudio, enableVideo } = state;
|
||||
await setNodeConfig(token,
|
||||
{ domain, accountStorage: accountStorage * 1073741824,
|
||||
keyType, enableImage, enableAudio, enableVideo });
|
||||
keyType, enableImage, enableAudio, enableVideo, pushSupported });
|
||||
updateState({ showSettings: false });
|
||||
}
|
||||
catch(err) {
|
||||
@ -117,9 +121,9 @@ export function useDashboard(token, config) {
|
||||
}, [viewport]);
|
||||
|
||||
useEffect(() => {
|
||||
const { accountStorage, domain, keyType, enableImage, enableAudio, enableVideo } = config;
|
||||
const { accountStorage, domain, keyType, pushSupported, enableImage, enableAudio, enableVideo } = config;
|
||||
updateState({ domain, accountStorage: Math.ceil(accountStorage / 1073741824), keyType,
|
||||
enableImage, enableAudio, enableVideo });
|
||||
enableImage, enableAudio, enableVideo, pushSupported });
|
||||
actions.getAccounts();
|
||||
// eslint-disable-next-line
|
||||
}, [config]);
|
||||
|
Loading…
Reference in New Issue
Block a user