v5.6.0-beta.1 (#116)
* Fix displaying versions in web/desktop * Update deps * Tag 5.6.0-beta.1
This commit is contained in:
parent
5eb01ac226
commit
e18a711abf
13 changed files with 635 additions and 679 deletions
|
|
@ -7,26 +7,26 @@ import { API } from "./http-api";
|
|||
import "./globals.css";
|
||||
|
||||
const RootWithVersion = () => {
|
||||
let [title, setTitle] = useState<string>("rqbit web UI");
|
||||
let [version, setVersion] = useState<string>("");
|
||||
useEffect(() => {
|
||||
const refreshVersion = () =>
|
||||
API.getVersion().then(
|
||||
(version) => {
|
||||
setVersion(version);
|
||||
const title = `rqbit web UI - v${version}`;
|
||||
setTitle(title);
|
||||
document.title = title;
|
||||
return 10000;
|
||||
},
|
||||
(e) => {
|
||||
return 1000;
|
||||
}
|
||||
},
|
||||
);
|
||||
return customSetInterval(refreshVersion, 0);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<APIContext.Provider value={API}>
|
||||
<RqbitWebUI title={title} />
|
||||
<RqbitWebUI title="rqbit web UI" version={version} />
|
||||
</APIContext.Provider>
|
||||
);
|
||||
};
|
||||
|
|
@ -34,5 +34,5 @@ const RootWithVersion = () => {
|
|||
ReactDOM.createRoot(document.getElementById("app") as HTMLInputElement).render(
|
||||
<StrictMode>
|
||||
<RootWithVersion />
|
||||
</StrictMode>
|
||||
</StrictMode>,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue