[Remote] Full PWA support, misc bugfixes (#280)

- Fix setting remote port properly
- Add web worker support (so it can be installed as an "app")
- build fixes/removing stray console.log
This commit is contained in:
Kendall Garner 2023-10-18 17:49:09 +00:00 committed by GitHub
parent fe298d3232
commit 9964f95d5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 314 additions and 194 deletions

View file

@ -28,24 +28,27 @@ export const RemoteSettings = () => {
title: enabled ? 'Error enabling remote' : 'Error disabling remote',
});
}
}, 100);
}, 50);
const debouncedChangeRemotePort = debounce(async (port: number) => {
const errorMsg = await remote!.setRemotePort(port);
if (errorMsg === null) {
if (!errorMsg) {
setSettings({
remote: {
...settings,
port,
},
});
toast.warn({
message: 'To have your port change take effect, stop and restart the server',
});
} else {
toast.error({
message: errorMsg,
title: 'Error setting port',
});
}
});
}, 100);
const isHidden = !isElectron();