mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Update typing for currentApiClient
This commit is contained in:
parent
d297f23932
commit
72dab5381d
3 changed files with 6 additions and 7 deletions
|
@ -129,7 +129,7 @@ const ConnectionRequired: FunctionComponent<ConnectionRequiredProps> = ({
|
|||
if (isAdminRequired) {
|
||||
try {
|
||||
const user = await client.getCurrentUser();
|
||||
if (!user.Policy.IsAdministrator) {
|
||||
if (!user.Policy?.IsAdministrator) {
|
||||
console.warn('[ConnectionRequired] normal user attempted to access admin route');
|
||||
bounce(await ServerConnections.connect());
|
||||
return;
|
||||
|
|
|
@ -86,6 +86,10 @@ class ServerConnections extends ConnectionManager {
|
|||
return this.localApiClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ApiClient that is currently connected.
|
||||
* @returns {ApiClient} apiClient
|
||||
*/
|
||||
currentApiClient() {
|
||||
let apiClient = this.getLocalApiClient();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue