Skip to content
This repository has been archived by the owner on Jun 20, 2021. It is now read-only.

Commit

Permalink
=== mobx-firelink
Browse files Browse the repository at this point in the history
* MS Firelink.LogIn and Firelink.LogOut work.
  • Loading branch information
Venryx committed Dec 12, 2019
1 parent 424b3f6 commit 263f6c1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Source/UI/@Shared/NavBar/UserPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import { Button, Div, Row } from 'react-vcomponents';
import { Column } from 'react-vcomponents';
import { E } from 'js-vextensions';
import { ShowMessageBox, BoxController } from 'react-vmessagebox';
import { Link, HandleError } from 'vwebapp-framework';
import { Link, HandleError, Observer } from 'vwebapp-framework';
import { store } from 'Store';
import { runInAction } from 'mobx';
import { IsAuthValid } from 'mobx-firelink';
import { fire } from 'Utils/LibIntegrations/MobXFirelink';
import { MeID } from '../../../Store/firebase/users';

@Observer
export class UserPanel extends BaseComponentPlus({} as {auth?}, {}) {
render() {
// authError: pathToJS(state.firebase, "authError"),
Expand Down Expand Up @@ -40,7 +41,7 @@ export class UserPanel extends BaseComponentPlus({} as {auth?}, {}) {
<Row mt={5}>
<Link ml="auto" mr={5} onContextMenu={(e) => e.nativeEvent['passThrough'] = true} actionFunc={(s) => {
s.main.page = 'profile';
store.main.topRightOpenPanel = null;
s.main.topRightOpenPanel = null;
}}>
<Button text="Edit profile" style={{ width: 100 }}/>
</Link>
Expand Down
6 changes: 4 additions & 2 deletions Source/Utils/AutoRuns/InitForNewlyLoadedMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import { Assert } from 'js-vextensions';
let lastMapID;
autorun(() => {
const mapID = GetOpenMapID();
if (mapID && mapID != lastMapID) {
if (mapID != lastMapID) {
lastMapID = mapID;
StartInitForNewlyLoadedMap(mapID);
if (mapID) {
StartInitForNewlyLoadedMap(mapID);
}
}
}, { name: 'InitForNewlyLoadedMap' });

Expand Down
4 changes: 3 additions & 1 deletion Source/Utils/AutoRuns/UserSignUpHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ let lastUserInfo;
autorun(() => {
if (fire.userInfo != lastUserInfo) {
lastUserInfo = fire.userInfo;
RunSignUpInitIfNotYetRun(fire.userInfo.id);
if (fire.userInfo) {
RunSignUpInitIfNotYetRun(fire.userInfo.id);
}
}
}, { name: 'UserSignUpHelper' });

Expand Down

0 comments on commit 263f6c1

Please sign in to comment.