mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix console errors
This commit is contained in:
parent
112f8627b5
commit
5f61a431de
4 changed files with 43 additions and 8 deletions
|
@ -46,7 +46,7 @@ const PluginDetailsTable: FC<PluginDetailsTableProps> = ({
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
{
|
{
|
||||||
(isPluginLoading || !pluginDetails?.version?.version && <Skeleton />)
|
(isPluginLoading && <Skeleton />)
|
||||||
|| pluginDetails?.version?.version
|
|| pluginDetails?.version?.version
|
||||||
}
|
}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|
|
@ -35,6 +35,7 @@ import Page from 'components/Page';
|
||||||
import { useApi } from 'hooks/useApi';
|
import { useApi } from 'hooks/useApi';
|
||||||
import globalize from 'scripts/globalize';
|
import globalize from 'scripts/globalize';
|
||||||
import { getPluginUrl } from 'utils/dashboard';
|
import { getPluginUrl } from 'utils/dashboard';
|
||||||
|
import { getUri } from 'utils/api';
|
||||||
|
|
||||||
interface AlertMessage {
|
interface AlertMessage {
|
||||||
severity?: 'success' | 'info' | 'warning' | 'error'
|
severity?: 'success' | 'info' | 'warning' | 'error'
|
||||||
|
@ -103,10 +104,7 @@ const PluginPage: FC = () => {
|
||||||
|
|
||||||
let imageUrl;
|
let imageUrl;
|
||||||
if (pluginInfo?.HasImage) {
|
if (pluginInfo?.HasImage) {
|
||||||
imageUrl = api?.axiosInstance.getUri({
|
imageUrl = getUri(`/Plugins/${pluginInfo.Id}/${pluginInfo.Version}/Image`, api);
|
||||||
baseURL: api.basePath,
|
|
||||||
url: `/Plugins/${pluginInfo.Id}/${pluginInfo.Version}/Image`
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -124,7 +122,21 @@ const PluginPage: FC = () => {
|
||||||
versions: packageInfo?.versions || []
|
versions: packageInfo?.versions || []
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}, [api?.axiosInstance, api?.basePath, configurationPages, isEnabledOverride, isPluginsLoading, packageInfo?.description, packageInfo?.imageUrl, packageInfo?.name, packageInfo?.overview, packageInfo?.owner, packageInfo?.versions, pluginId, pluginName, plugins]);
|
}, [
|
||||||
|
api,
|
||||||
|
configurationPages,
|
||||||
|
isEnabledOverride,
|
||||||
|
isPluginsLoading,
|
||||||
|
packageInfo?.description,
|
||||||
|
packageInfo?.imageUrl,
|
||||||
|
packageInfo?.name,
|
||||||
|
packageInfo?.overview,
|
||||||
|
packageInfo?.owner,
|
||||||
|
packageInfo?.versions,
|
||||||
|
pluginId,
|
||||||
|
pluginName,
|
||||||
|
plugins
|
||||||
|
]);
|
||||||
|
|
||||||
const alertMessages = useMemo(() => {
|
const alertMessages = useMemo(() => {
|
||||||
const alerts: AlertMessage[] = [];
|
const alerts: AlertMessage[] = [];
|
||||||
|
|
|
@ -20,8 +20,14 @@ const MarkdownBox: FC<MarkdownBoxProps> = ({
|
||||||
undefined
|
undefined
|
||||||
}
|
}
|
||||||
sx={{
|
sx={{
|
||||||
'> :first-child': { marginTop: 0, paddingTop: 0 },
|
'> :first-child /* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */': {
|
||||||
'> :last-child': { marginBottom: 0, paddingBottom: 0 }
|
marginTop: 0,
|
||||||
|
paddingTop: 0
|
||||||
|
},
|
||||||
|
'> :last-child': {
|
||||||
|
marginBottom: 0,
|
||||||
|
paddingBottom: 0
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{markdown ? undefined : fallback}
|
{markdown ? undefined : fallback}
|
||||||
|
|
17
src/utils/api.ts
Normal file
17
src/utils/api.ts
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
import type { Api } from '@jellyfin/sdk';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a full URI for a relative URL to the Jellyfin server for a given SDK Api instance.
|
||||||
|
* TODO: Add to SDK
|
||||||
|
* @param api - The Jellyfin SDK Api instance.
|
||||||
|
* @param url - The relative URL.
|
||||||
|
* @returns The complete URI with protocol, host, and base URL (if any).
|
||||||
|
*/
|
||||||
|
export const getUri = (url: string, api?: Api) => {
|
||||||
|
if (!api) return;
|
||||||
|
|
||||||
|
return api.axiosInstance.getUri({
|
||||||
|
baseURL: api.basePath,
|
||||||
|
url
|
||||||
|
});
|
||||||
|
};
|
Loading…
Add table
Add a link
Reference in a new issue