on master help sign in
Another MM fix
5e84d23Will Galebach
src/components/Passport.js+2−2
@@ -218,7 +218,7 @@ function MiniPassport({
218 processing = false,
218 processing = false,
219 ...rest
219 ...rest
220}) {
220}) {
221− useSyncDetails([point]);
221+ // useSyncDetails([point]);
222 // const { wallet } = useWallet();
222 // const { wallet } = useWallet();
223 // const address = need.addressFromWallet(wallet);
223 // const address = need.addressFromWallet(wallet);
224 // const permissions = usePermissionsForPoint(address, point);
224 // const permissions = usePermissionsForPoint(address, point);
@@ -239,7 +239,7 @@ function MiniPassport({
239 return (
239 return (
240 <div {...rest} className="sigil-mini">
240 <div {...rest} className="sigil-mini">
241 <div className={className}>{sigil}</div>
241 <div className={className}>{sigil}</div>
242− <span className="patp">{patp}</span>
242+ <span className="patp mono">{patp}</span>
243 {locked && <Icon color="white" icon="Locked" className="lock" />}
243 {locked && <Icon color="white" icon="Locked" className="lock" />}
244 </div>
244 </div>
245 );
245 );
src/store/network.js+1−1
@@ -126,7 +126,7 @@ function _useNetwork(initialNetworkType = null) {
126 })();
126 })();
127 }, [networkType, metamask]);
127 }, [networkType, metamask]);
128
128
129− return { networkType, setNetworkType, web3, contracts };
129+ return { networkType, setNetworkType, setMetamask, web3, contracts };
130}
130}
131
131
132const NetworkContext = createContext(null);
132const NetworkContext = createContext(null);
src/views/Login/Metamask.js+8−4
@@ -1,4 +1,4 @@
1−import React, { useCallback } from 'react';
1+import React, { useCallback, useEffect } from 'react';
2import { Grid, Text, LinkButton, H5 } from 'indigo-react';
2import { Grid, Text, LinkButton, H5 } from 'indigo-react';
3import { Just } from 'folktale/maybe';
3import { Just } from 'folktale/maybe';
4import { FORM_ERROR } from 'final-form';
4import { FORM_ERROR } from 'final-form';
@@ -24,11 +24,15 @@ export default function Metamask({ className, goHome }) {
24 useLoginView(WALLET_TYPES.METAMASK);
24 useLoginView(WALLET_TYPES.METAMASK);
25 const { setWallet, setWalletType, setAuthToken } = useWallet();
25 const { setWallet, setWalletType, setAuthToken } = useWallet();
26
26
27− const { web3 } = useNetwork();
27+ const { web3, setMetamask } = useNetwork();
28− const _web3 = need.web3(web3);
28+
29+ useEffect(() => {
30+ setMetamask(true);
31+ }, []); // eslint-disable-line react-hooks/exhaustive-deps
29
32
30 const onSubmit = useCallback(async () => {
33 const onSubmit = useCallback(async () => {
31 try {
34 try {
35+ const _web3 = need.web3(web3);
32 const accounts = await window.ethereum.send('eth_requestAccounts');
36 const accounts = await window.ethereum.send('eth_requestAccounts');
33 const wallet = new MetamaskWallet(accounts.result[0]);
37 const wallet = new MetamaskWallet(accounts.result[0]);
34
38
@@ -45,7 +49,7 @@ export default function Metamask({ className, goHome }) {
45 console.error(e);
49 console.error(e);
46 return { [FORM_ERROR]: e.message };
50 return { [FORM_ERROR]: e.message };
47 }
51 }
48− }, [_web3, setAuthToken, setWallet, setWalletType]);
52+ }, [web3, setAuthToken, setWallet, setWalletType]);
49
53
50 return (
54 return (
51 <Grid className={className}>
55 <Grid className={className}>
src/views/Point/IssueChild.tsx+36−25
@@ -120,6 +120,7 @@ export default function IssueChild() {
120 await spawnPoint(pointToSpawn, destinationAddress);
120 await spawnPoint(pointToSpawn, destinationAddress);
121 checkForUpdates(pointToSpawn);
121 checkForUpdates(pointToSpawn);
122 setPointToSpawn(null);
122 setPointToSpawn(null);
123+ setDestinationAddress(null);
123 setL2SpawnSent(true);
124 setL2SpawnSent(true);
124 setLoading(false);
125 setLoading(false);
125 }
126 }
@@ -199,9 +200,11 @@ export default function IssueChild() {
199 const validAddress =
200 const validAddress =
200 destinationAddress && !buildAddressValidator()(destinationAddress);
201 destinationAddress && !buildAddressValidator()(destinationAddress);
201
202
203+ const pointType = point.isStar ? 'planet' : 'star';
204+
202 const getButtonText = () => {
205 const getButtonText = () => {
203 if (!validPoint) {
206 if (!validPoint) {
204− return `Please enter a valid ${point.isStar ? 'planet' : 'star'}`;
207+ return `Please enter a valid ${pointType}`;
205 } else if (!validAddress) {
208 } else if (!validAddress) {
206 return `Please enter a valid destination address`;
209 return `Please enter a valid destination address`;
207 }
210 }
@@ -234,16 +237,25 @@ export default function IssueChild() {
234 full
237 full
235 as={'div'}
238 as={'div'}
236 style={{ fontSize: 14 }}
239 style={{ fontSize: 14 }}
237− className={cn('f5 wrap mb5', {
240+ className={cn('f5 wrap', {
238 green3: completed,
241 green3: completed,
239 })}>
242 })}>
240 <span className="mono">{values.point}</span> has been
243 <span className="mono">{values.point}</span> has been
241 spawned and can be claimed by{' '}
244 spawned and can be claimed by{' '}
242 <CopiableAddress>{values.owner}</CopiableAddress>.
245 <CopiableAddress>{values.owner}</CopiableAddress>.
246+ <Grid.Item
247+ as={Button}
248+ full
249+ className="mt6"
250+ center
251+ solid
252+ onClick={() => pop()}>
253+ Go back
254+ </Grid.Item>
243 </Grid.Item>
255 </Grid.Item>
244 )}
256 )}
245
257
246− {!completed && (
258+ {!(completed || l2SpawnSent) && (
247 <>
259 <>
248 <Grid.Item
260 <Grid.Item
249 full
261 full
@@ -289,30 +301,29 @@ export default function IssueChild() {
289 <AddressButton>Use my address</AddressButton>
301 <AddressButton>Use my address</AddressButton>
290 </Box>
302 </Box>
291 )}
303 )}
304+ <Grid.Item full as={FormError} />
305+
306+ {point.isL2Spawn ? (
307+ <Grid.Item
308+ as={Button}
309+ full
310+ className="mt4"
311+ center
312+ solid
313+ disabled={!validPoint || !validAddress}
314+ onClick={spawnNewPoint}>
315+ {getButtonText()}
316+ </Grid.Item>
317+ ) : (
318+ <Grid.Item
319+ full
320+ as={InlineEthereumTransaction}
321+ {...bind}
322+ onReturn={() => pop()}
323+ />
324+ )}
292 </>
325 </>
293 )}
326 )}
294−
295− <Grid.Item full as={FormError} />
296−
297− {point.isL2Spawn ? (
298− <Grid.Item
299− as={Button}
300− full
301− className="mt4"
302− center
303− solid
304− disabled={!validPoint || !validAddress}
305− onClick={spawnNewPoint}>
306− {getButtonText()}
307− </Grid.Item>
308− ) : (
309− <Grid.Item
310− full
311− as={InlineEthereumTransaction}
312− {...bind}
313− onReturn={() => pop()}
314− />
315− )}
316 </>
327 </>
317 )}
328 )}
318 </BridgeForm>
329 </BridgeForm>
src/views/Point/MigrateL2.tsx+1−1
@@ -61,7 +61,7 @@ const PointEntry = ({
61 <Box className="sigil">
61 <Box className="sigil">
62 <Sigil patp={patp} size={1} colors={['#000000', '#FFFFFF']} />
62 <Sigil patp={patp} size={1} colors={['#000000', '#FFFFFF']} />
63 </Box>
63 </Box>
64− <Box>{patp}</Box>
64+ <Box className="mono">{patp}</Box>
65 </Row>
65 </Row>
66 );
66 );
67};
67};