mirror of
https://github.com/balzack/databag.git
synced 2025-02-15 21:19:16 +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.Option value="RSA4096">RSA 4096</Select.Option>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</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 class="field">
|
||||||
<div>Enable Image Queue: </div>
|
<div>Enable Image Queue: </div>
|
||||||
<Switch onChange={(e) => actions.setEnableImage(e)} size="small"
|
<Switch onChange={(e) => actions.setEnableImage(e)} size="small"
|
||||||
|
@ -11,6 +11,7 @@ export function useDashboard(token, config) {
|
|||||||
domain: "",
|
domain: "",
|
||||||
accountStorage: null,
|
accountStorage: null,
|
||||||
keyType: null,
|
keyType: null,
|
||||||
|
pushSupported: null,
|
||||||
enableImage: null,
|
enableImage: null,
|
||||||
enableAudio: null,
|
enableAudio: null,
|
||||||
enableVideo: null,
|
enableVideo: null,
|
||||||
@ -58,6 +59,9 @@ export function useDashboard(token, config) {
|
|||||||
setKeyType: (keyType) => {
|
setKeyType: (keyType) => {
|
||||||
updateState({ keyType });
|
updateState({ keyType });
|
||||||
},
|
},
|
||||||
|
setPushSupported: (pushSupported) => {
|
||||||
|
updateState({ pushSupported });
|
||||||
|
},
|
||||||
setEnableImage: (enableImage) => {
|
setEnableImage: (enableImage) => {
|
||||||
updateState({ enableImage });
|
updateState({ enableImage });
|
||||||
},
|
},
|
||||||
@ -74,10 +78,10 @@ export function useDashboard(token, config) {
|
|||||||
if (!state.busy) {
|
if (!state.busy) {
|
||||||
updateState({ busy: true });
|
updateState({ busy: true });
|
||||||
try {
|
try {
|
||||||
const { domain, keyType, accountStorage, enableImage, enableAudio, enableVideo } = state;
|
const { domain, keyType, accountStorage, pushSupported, enableImage, enableAudio, enableVideo } = state;
|
||||||
await setNodeConfig(token,
|
await setNodeConfig(token,
|
||||||
{ domain, accountStorage: accountStorage * 1073741824,
|
{ domain, accountStorage: accountStorage * 1073741824,
|
||||||
keyType, enableImage, enableAudio, enableVideo });
|
keyType, enableImage, enableAudio, enableVideo, pushSupported });
|
||||||
updateState({ showSettings: false });
|
updateState({ showSettings: false });
|
||||||
}
|
}
|
||||||
catch(err) {
|
catch(err) {
|
||||||
@ -117,9 +121,9 @@ export function useDashboard(token, config) {
|
|||||||
}, [viewport]);
|
}, [viewport]);
|
||||||
|
|
||||||
useEffect(() => {
|
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,
|
updateState({ domain, accountStorage: Math.ceil(accountStorage / 1073741824), keyType,
|
||||||
enableImage, enableAudio, enableVideo });
|
enableImage, enableAudio, enableVideo, pushSupported });
|
||||||
actions.getAccounts();
|
actions.getAccounts();
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
}, [config]);
|
}, [config]);
|
||||||
|
Loading…
Reference in New Issue
Block a user