diff --git a/src/src/components/LiveUpdateSettings/LiveUpdateSettings.tsx b/src/src/components/LiveUpdateSettings/LiveUpdateSettings.tsx index fb9591ca..5c8dc03f 100644 --- a/src/src/components/LiveUpdateSettings/LiveUpdateSettings.tsx +++ b/src/src/components/LiveUpdateSettings/LiveUpdateSettings.tsx @@ -13,24 +13,29 @@ export interface ILiveUpdateSettingsProp { function LiveUpdateSettings( props: ILiveUpdateSettingsProp, -): React.FunctionComponentElement { - return ( - -
- - Live Update: - - { - props.onLiveUpdateConfigChange({ enabled: !props.enabled }); - }} - size='small' - color='primary' - /> -
-
- ); +): React.FunctionComponentElement | null { + //@ts-ignore + if (window.live_updates_enabled == 1) { + return ( + +
+ + Live Update: + + { + props.onLiveUpdateConfigChange({ enabled: !props.enabled }); + }} + size='small' + color='primary' + /> +
+
+ ); + } + props.onLiveUpdateConfigChange({ enabled: false }); + return null; } export default React.memo(LiveUpdateSettings); diff --git a/src/src/services/models/projects/projectsModel.ts b/src/src/services/models/projects/projectsModel.ts index 4422c903..a892f888 100644 --- a/src/src/services/models/projects/projectsModel.ts +++ b/src/src/services/models/projects/projectsModel.ts @@ -24,6 +24,8 @@ function getProjectsData() { }).then((data: IProject) => { //@ts-ignore window.telemetry_enabled = data.telemetry_enabled; + //@ts-ignore + window.live_updates_enabled = data.live_updates_enabled; model.setState({ project: data, });