diff --git a/apps/phone/src/apps/browser/components/BrowserApp.tsx b/apps/phone/src/apps/browser/components/BrowserApp.tsx index c16bc3af3..6ccef9fab 100644 --- a/apps/phone/src/apps/browser/components/BrowserApp.tsx +++ b/apps/phone/src/apps/browser/components/BrowserApp.tsx @@ -1,11 +1,12 @@ import { AppWrapper } from '@ui/components'; import { styled } from '@mui/material/styles'; -import React, { Reducer, useReducer, useRef } from 'react'; +import React, {Reducer, useEffect, useReducer, useRef} from 'react'; import { AppContent } from '@ui/components/AppContent'; import { Box } from '@mui/material'; import { BrowserURLBar } from './BrowserURLBar'; import { promiseTimeout } from '../../../utils/promiseTimeout'; import { usePhoneConfig } from '../../../config/hooks/usePhoneConfig'; +import {useConfig, usePhone} from "@os/phone/hooks"; const PREFIX = 'BrowserApp'; @@ -59,9 +60,11 @@ const browserReducer: Reducer = (state, action) => export const BrowserApp: React.FC = () => { const [{ appSettings }] = usePhoneConfig(); + const { ResourceConfig } = usePhone(); + const [browserState, dispatch] = useReducer(browserReducer, { - browserUrl: appSettings.browserHomePage, - browserHistory: [appSettings.browserHomePage], + browserUrl: ResourceConfig.browser.homepageUrl ?? "", + browserHistory: [ResourceConfig.browser.homepageUrl ?? ""], }); const { browserHistory, browserUrl } = browserState; @@ -90,6 +93,12 @@ export const BrowserApp: React.FC = () => { dispatch({ payload: strCopy, type: ReducerActionsType.SET_URL }); }; + useEffect(() => { + if (ResourceConfig.browser.homepageUrl) { + _setBrowserUrl(ResourceConfig.browser.homepageUrl) + } + }, [ResourceConfig.browser.homepageUrl]); + return ( diff --git a/config.default.json b/config.default.json index 7c4042947..4913b111c 100644 --- a/config.default.json +++ b/config.default.json @@ -86,6 +86,9 @@ "marketplace": { "persistListings": false }, + "browser": { + "homepageUrl": "https://docs.projecterror.dev" + }, "debug": { "level": "error", "enabled": true, diff --git a/config.json b/config.json index 78a584470..e47667dd4 100644 --- a/config.json +++ b/config.json @@ -5,7 +5,7 @@ "exportFunction": "myCheckerFunction" }, "general": { - "useResourceIntegration": false, + "useResourceIntegration": true, "toggleKey": "f1", "toggleCommand": "phone", "defaultLanguage": "en" @@ -21,8 +21,8 @@ }, "database": { "useIdentifierPrefix": false, - "playerTable": "users", - "identifierColumn": "identifier", + "playerTable": "players", + "identifierColumn": "citizenid", "identifierType": "license", "profileQueries": true, "phoneNumberColumn": "phone_number" @@ -32,6 +32,9 @@ "enabled": true, "sentryEnabled": true }, + "browser": { + "homepageUrl": "https://docs.fivemanage.com" + }, "defaultContacts": [], "disabledApps": [], "apps": [], diff --git a/typings/config.ts b/typings/config.ts index 43ff6b008..16383eb4c 100644 --- a/typings/config.ts +++ b/typings/config.ts @@ -115,6 +115,10 @@ export interface DefaultContact { avatar?: string; } +export interface BrowserConfig { + homepageUrl: string; +} + export interface ResourceConfig { database: DatabaseConfig; Locale: string; @@ -128,6 +132,7 @@ export interface ResourceConfig { notificationPosition: NotificationConfig; defaultContacts: DefaultContact[]; general: General; + browser: BrowserConfig; debug: Debug; images: ImageConfig; imageSafety: ImageSafety;