aboutsummaryrefslogtreecommitdiffstats
path: root/src/web
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-05-19 07:53:30 -0500
committerJP Dillingham <jp@dillingham.me>2022-05-19 07:53:30 -0500
commit48abb95768fb3f221924359f4947624b5996dfd1 (patch)
treec3b07c39cc8d295bd203e8341bdda2e8f880c835 /src/web
parentf1c5fe2f560e2f868a5b1cfde23789ce871cfd42 (diff)
downloadslskd-48abb95768fb3f221924359f4947624b5996dfd1.tar.gz
disable controls if disconnected from server
Diffstat (limited to 'src/web')
-rw-r--r--src/web/src/components/Search/Searches.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/web/src/components/Search/Searches.js b/src/web/src/components/Search/Searches.js
index c1a3a893..9b0c3dd4 100644
--- a/src/web/src/components/Search/Searches.js
+++ b/src/web/src/components/Search/Searches.js
@@ -20,7 +20,7 @@ import {
import SearchDetail from './Detail/SearchDetail';
import ErrorSegment from '../Shared/ErrorSegment';
-const Searches = () => {
+const Searches = ({ server }) => {
const [connecting, setConnecting] = useState(true);
const [error, setError] = useState(undefined);
const [searches, setSearches] = useState({});
@@ -190,12 +190,12 @@ const Searches = () => {
size='big'
ref={inputRef}
loading={creating}
- disabled={creating}
+ disabled={creating || !server.isConnected}
className='search-input'
placeholder="Search phrase"
action={<>
- <Button icon='plus' onClick={create}/>
- <Button icon='search' onClick={() => create({ navigate: true })}/>
+ <Button icon='plus' disabled={creating || !server.isConnected} onClick={create}/>
+ <Button icon='search' disabled={creating || !server.isConnected} onClick={() => create({ navigate: true })}/>
</>}
onKeyUp={(e) => e.key === 'Enter' ? create() : ''}
/>