Merge remote-tracking branch 'overseerr/develop' into develop
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { MediaServerType } from '@server/constants/server';
|
||||
import type { PublicSettingsResponse } from '@server/interfaces/api/settingsInterfaces';
|
||||
import React from 'react';
|
||||
import useSWR from 'swr';
|
||||
import { MediaServerType } from '../../server/constants/server';
|
||||
import { PublicSettingsResponse } from '../../server/interfaces/api/settingsInterfaces';
|
||||
|
||||
export interface SettingsContextProps {
|
||||
currentSettings: PublicSettingsResponse;
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
|
||||
const defaultSettings = {
|
||||
@@ -31,10 +32,10 @@ export const SettingsContext = React.createContext<SettingsContextProps>({
|
||||
currentSettings: defaultSettings,
|
||||
});
|
||||
|
||||
export const SettingsProvider: React.FC<SettingsContextProps> = ({
|
||||
export const SettingsProvider = ({
|
||||
children,
|
||||
currentSettings,
|
||||
}) => {
|
||||
}: SettingsContextProps) => {
|
||||
const { data, error } = useSWR<PublicSettingsResponse>(
|
||||
'/api/v1/settings/public',
|
||||
{ fallbackData: currentSettings }
|
||||
|
||||
Reference in New Issue
Block a user