mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-15 16:20:03 +00:00
Fixed various smaller issues
This commit is contained in:
@@ -35,9 +35,11 @@ export default function GameRequestView() {
|
||||
const gameRequests = useSnapshot(gameRequestState).gameRequests;
|
||||
|
||||
const [areGameRequestsEnabled, setAreGameRequestsEnabled] = useState(false);
|
||||
const [areGuestsAllowedToRequestGames, setAreGuestsAllowedToRequestGames] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
ConfigEndpoint.areGameRequestsEnabled().then(setAreGameRequestsEnabled);
|
||||
ConfigEndpoint.areGuestsAllowedToRequestGames().then(setAreGuestsAllowedToRequestGames);
|
||||
}, []);
|
||||
|
||||
const [searchTerm, setSearchTerm] = useState("");
|
||||
@@ -168,7 +170,7 @@ export default function GameRequestView() {
|
||||
color="primary"
|
||||
startContent={<PlusCircle weight="fill"/>}
|
||||
onPress={requestGameModal.onOpen}
|
||||
isDisabled={!areGameRequestsEnabled}>
|
||||
isDisabled={!areGameRequestsEnabled || (!auth.state.user && !areGuestsAllowedToRequestGames)}>
|
||||
Request a Game
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -94,18 +94,16 @@ export default function MainLayout() {
|
||||
</Tooltip>
|
||||
</NavbarContent>}
|
||||
<NavbarContent justify="end" className="items-center">
|
||||
{auth.state.user &&
|
||||
<NavbarItem>
|
||||
<Tooltip content="Request a game" placement="bottom">
|
||||
<Button color="primary"
|
||||
isDisabled={window.location.pathname.startsWith("/requests")}
|
||||
onPress={() => navigate("/requests")}
|
||||
startContent={<Disc weight="fill"/>}>
|
||||
Requests
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</NavbarItem>
|
||||
}
|
||||
<NavbarItem>
|
||||
<Tooltip content="Request a game" placement="bottom">
|
||||
<Button color="primary"
|
||||
isDisabled={window.location.pathname.startsWith("/requests")}
|
||||
onPress={() => navigate("/requests")}
|
||||
startContent={<Disc weight="fill"/>}>
|
||||
Requests
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</NavbarItem>
|
||||
{isAdmin(auth) &&
|
||||
<NavbarItem>
|
||||
<Tooltip content="View library scan results" placement="bottom">
|
||||
|
||||
Reference in New Issue
Block a user