aboutsummaryrefslogtreecommitdiff
path: root/modern/src/other
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-08-28 10:08:06 -0700
committerAnton Tananaev <anton@traccar.org>2022-08-28 10:08:06 -0700
commitec740a9802939662ecce049f82b33896b0d3b3a6 (patch)
tree5531bbf2ffa24656133d48607f6966cd0d40a04b /modern/src/other
parentb4a769e15fb18d854af56c24e39b0b72fff273a0 (diff)
downloadtrackermap-web-ec740a9802939662ecce049f82b33896b0d3b3a6.tar.gz
trackermap-web-ec740a9802939662ecce049f82b33896b0d3b3a6.tar.bz2
trackermap-web-ec740a9802939662ecce049f82b33896b0d3b3a6.zip
Server loading state
Diffstat (limited to 'modern/src/other')
-rw-r--r--modern/src/other/ChangeServerPage.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/modern/src/other/ChangeServerPage.js b/modern/src/other/ChangeServerPage.js
index edce3cd7..70b18993 100644
--- a/modern/src/other/ChangeServerPage.js
+++ b/modern/src/other/ChangeServerPage.js
@@ -16,6 +16,7 @@ const officialServers = [
'https://demo4.traccar.org',
'https://server.traccar.org',
'http://localhost:8082',
+ 'http://localhost:3000',
];
const useStyles = makeStyles((theme) => ({
@@ -38,8 +39,10 @@ const ChangeServerPage = () => {
const t = useTranslation();
const [url, setUrl] = useState(currentServer);
+ const [loading, setLoading] = useState(false);
const handleSubmit = () => {
+ setLoading(true);
if (window.webkit && window.webkit.messageHandlers.appInterface) {
window.webkit.messageHandlers.appInterface.postMessage(`server|${url}`);
} else if (window.appInterface) {
@@ -60,7 +63,7 @@ const ChangeServerPage = () => {
value={url}
onChange={(_, value) => setUrl(value)}
/>
- <Button variant="outlined" color="secondary" onClick={handleSubmit}>{t('sharedSave')}</Button>
+ <Button variant="outlined" color="secondary" onClick={handleSubmit} disabled={loading}>{t('sharedSave')}</Button>
</Container>
);
};