on master help sign in
Re-enable on-mount logic in Login
9c0d440Fang
src/views/Login.js+10−7
@@ -1,5 +1,5 @@
1import { Nothing, Just } from 'folktale/maybe';
1import { Nothing, Just } from 'folktale/maybe';
2−import React, { useState } from 'react';
2+import React, { useState, useEffect } from 'react';
3import * as azimuth from 'azimuth-js';
3import * as azimuth from 'azimuth-js';
4
4
5import { H1 } from 'indigo-react';
5import { H1 } from 'indigo-react';
@@ -28,17 +28,20 @@ export default function Login() {
28 // globals
28 // globals
29 const history = useHistory();
29 const history = useHistory();
30 const { contracts } = useNetwork();
30 const { contracts } = useNetwork();
31− const { wallet } = useWallet();
31+ const { wallet, setUrbitWallet } = useWallet();
32 const { pointCursor, setPointCursor } = usePointCursor();
32 const { pointCursor, setPointCursor } = usePointCursor();
33
33
34 // inputs
34 // inputs
35 const [currentTab, setCurrentTab] = useState(TABS.TICKET);
35 const [currentTab, setCurrentTab] = useState(TABS.TICKET);
36
36
37− //TODO figure out how to do things once
37+ useEffect(() => {
38− // // we expect wallet and pointCursor to not be set yet
38+ // on-mount
39− // setUrbitWallet(Nothing());
39+ setUrbitWallet(Nothing());
40− // setWallet(Nothing());
41− // setPointCursor(Nothing());
40+ setPointCursor(Nothing());
41+
42+ // on-unmount
43+ return () => {};
44+ }, []);
42
45
43 const doContinue = async () => {
46 const doContinue = async () => {
44 const realWallet = need.wallet(wallet);
47 const realWallet = need.wallet(wallet);