fix: dev account server
This commit is contained in:
@@ -20,16 +20,6 @@ export const AdvancedOptions: FunctionComponent<Props> = observer(
|
|||||||
appState.accountMenu;
|
appState.accountMenu;
|
||||||
const [showAdvanced, setShowAdvanced] = useState(false);
|
const [showAdvanced, setShowAdvanced] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (isDev && window._devAccountServer) {
|
|
||||||
setEnableServerOption(true);
|
|
||||||
setServer(window._devAccountServer);
|
|
||||||
application.setCustomHost(window._devAccountServer);
|
|
||||||
}
|
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
|
|
||||||
const handleServerOptionChange = (e: Event) => {
|
const handleServerOptionChange = (e: Event) => {
|
||||||
if (e.target instanceof HTMLInputElement) {
|
if (e.target instanceof HTMLInputElement) {
|
||||||
setEnableServerOption(e.target.checked);
|
setEnableServerOption(e.target.checked);
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { isDev } from '@/utils';
|
||||||
import {
|
import {
|
||||||
action,
|
action,
|
||||||
computed,
|
computed,
|
||||||
@@ -74,7 +75,11 @@ export class AccountMenuState {
|
|||||||
this.appEventListeners.push(
|
this.appEventListeners.push(
|
||||||
this.application.addEventObserver(async () => {
|
this.application.addEventObserver(async () => {
|
||||||
runInAction(() => {
|
runInAction(() => {
|
||||||
this.setServer(this.application.getHost());
|
if (isDev && window._devAccountServer) {
|
||||||
|
this.setServer(window._devAccountServer);
|
||||||
|
} else {
|
||||||
|
this.setServer(this.application.getHost());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}, ApplicationEvent.Launched)
|
}, ApplicationEvent.Launched)
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user