Copying some settings values to status to avoid calling both /settings and /status.

This commit is contained in:
Roland 2022-10-16 11:53:44 -06:00
parent 78218d3559
commit dbdcc7a57c
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
10 changed files with 105 additions and 68 deletions

View file

@ -3,7 +3,7 @@ import {Card, Container, Image, Input, Pagination, Responsive, TableCell, TableR
import {Link, NavLink} from "react-router-dom";
import Message from "semantic-ui-react/dist/commonjs/collections/Message";
import {useDownloaders, useHotspot, useThrottle} from "../hooks/customHooks";
import {darkTheme, SettingsContext, ThemeContext} from "../contexts/contexts";
import {darkTheme, StatusContext, ThemeContext} from "../contexts/contexts";
import {Button, CardIcon, Form, Header, Icon, Menu, Popup, Statistic} from "./Theme";
export const API_URI = `http://${window.location.host}/api`;
@ -471,8 +471,8 @@ export function SearchInput({
}
export function WROLModeMessage({content}) {
const settings = useContext(SettingsContext);
const wrol_mode = settings ? settings.wrol_mode : null;
const {status} = useContext(StatusContext);
const wrol_mode = status ? status.wrol_mode : null;
if (wrol_mode) {
return <Message icon='lock' header='WROL Mode Enabled' content={content}/>