fix: wrap async func in useEffect

This commit is contained in:
Arthur E. Jones 2022-07-14 14:34:43 -05:00 committed by James Long
parent 3290e73978
commit 1a449ae0b8

View file

@ -476,7 +476,8 @@ function SettingsLink({ to, name, style, first, last }) {
function Version() { function Version() {
let [version, setVersion] = useState(''); let [version, setVersion] = useState('');
useEffect(async () => { useEffect(() => {
(async () => {
const { error, version } = await send('get-server-version'); const { error, version } = await send('get-server-version');
if (error) { if (error) {
@ -484,6 +485,7 @@ function Version() {
} else { } else {
setVersion(version); setVersion(version);
} }
})();
}, []); }, []);
return ( return (