From f1c4f81a68f00c7289b9dac167580cfc84d4118d Mon Sep 17 00:00:00 2001 From: Derick M <58572875+TurtIeSocks@users.noreply.github.com> Date: Fri, 13 Jan 2023 14:10:27 -0500 Subject: [PATCH] dangerous config option --- client/src/App.tsx | 1 + client/src/assets/types.ts | 1 + client/src/components/dialogs/Manager.tsx | 4 +++- client/src/components/drawer/routing/index.tsx | 2 +- client/src/hooks/useStatic.ts | 2 ++ server/api/src/private/misc.rs | 1 + server/model/src/api/args.rs | 1 + 7 files changed, 10 insertions(+), 2 deletions(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index 73b26d15..adc8a92d 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -68,6 +68,7 @@ export default function App() { if (res.tile_server) { setStatic('tileServer', res.tile_server) } + setStatic('dangerous', res.dangerous || false) } else { router.navigate('/login') } diff --git a/client/src/assets/types.ts b/client/src/assets/types.ts index 1a8e3488..91e22262 100644 --- a/client/src/assets/types.ts +++ b/client/src/assets/types.ts @@ -53,6 +53,7 @@ export interface Config { tile_server: string scanner_type: string logged_in: boolean + dangerous: boolean } export interface Circle { diff --git a/client/src/components/dialogs/Manager.tsx b/client/src/components/dialogs/Manager.tsx index 0ba4c906..605bb545 100644 --- a/client/src/components/dialogs/Manager.tsx +++ b/client/src/components/dialogs/Manager.tsx @@ -4,7 +4,9 @@ import { Button, Dialog, DialogActions, DialogContent } from '@mui/material' import type { Feature, FeatureCollection } from 'geojson' import useDeepCompareEffect from 'use-deep-compare-effect' +import { useStatic } from '@hooks/useStatic' import { save } from '@services/fetches' + import DialogHeader from './Header' import { Code } from '../Code' @@ -73,7 +75,7 @@ export default function Manager({ open, setOpen, geojson }: Props) { Save to Koji