Skip to content

Commit

Permalink
fix: dev account server
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed Jan 17, 2022
1 parent 5e07697 commit c232a5e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
10 changes: 0 additions & 10 deletions app/assets/javascripts/components/AccountMenu/AdvancedOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@ export const AdvancedOptions: FunctionComponent<Props> = observer(
appState.accountMenu;
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) => {
if (e.target instanceof HTMLInputElement) {
setEnableServerOption(e.target.checked);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { isDev } from '@/utils';
import {
action,
computed,
Expand Down Expand Up @@ -74,7 +75,11 @@ export class AccountMenuState {
this.appEventListeners.push(
this.application.addEventObserver(async () => {
runInAction(() => {
this.setServer(this.application.getHost());
if (isDev && window._devAccountServer) {
this.setServer(window._devAccountServer);
} else {
this.setServer(this.application.getHost());
}
});
}, ApplicationEvent.Launched)
);
Expand Down

0 comments on commit c232a5e

Please sign in to comment.