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:
Igor Katson 2024-04-06 09:37:31 +01:00 committed by GitHub
parent 5eb01ac226
commit e18a711abf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 635 additions and 679 deletions

View file

@ -23,26 +23,26 @@ export interface ContextType {
export const RqbitWebUI = (props: {
title: string;
version: string;
menuButtons?: JSX.Element[];
}) => {
let [logsOpened, setLogsOpened] = useState<boolean>(false);
const setCloseableError = useErrorStore((state) => state.setCloseableError);
const setOtherError = useErrorStore((state) => state.setOtherError);
const API = useContext(APIContext);
const setTorrents = useTorrentStore((state) => state.setTorrents);
const setTorrentsLoading = useTorrentStore(
(state) => state.setTorrentsLoading
(state) => state.setTorrentsLoading,
);
const setRefreshTorrents = useTorrentStore(
(state) => state.setRefreshTorrents
(state) => state.setRefreshTorrents,
);
const refreshTorrents = async () => {
setTorrentsLoading(true);
let torrents = await API.listTorrents().finally(() =>
setTorrentsLoading(false)
setTorrentsLoading(false),
);
setTorrents(torrents.torrents);
};
@ -60,20 +60,15 @@ export const RqbitWebUI = (props: {
setOtherError({ text: "Error refreshing torrents", details: e });
console.error(e);
return 5000;
}
},
),
0
0,
);
}, []);
const context: ContextType = {
setCloseableError,
refreshTorrents,
};
return (
<div className="dark:bg-gray-900 dark:text-gray-200 min-h-screen">
<Header title={props.title} />
<Header title={props.title} version={props.version} />
<div className="relative">
{/* Menu buttons */}
<div className="absolute top-0 start-0 pl-2 z-10">