@@ -47,70 +47,59 @@ export default function Ticket({ className, goHome }) {
47 return errors;
47 return errors;
50+ await timeout(100); // allow ui events to flush
50 if (values.useShards) {
53 if (values.useShards) {
51 if (errors.shard1 || errors.shard2 || errors.shard3) {
54 if (errors.shard1 || errors.shard2 || errors.shard3) {
52 return errors;
55 return errors;
57− const ticket = kg.combine([
58+ ticket = kg.combine([values.shard1, values.shard2, values.shard3]);
62− const point = patp2dec(values.point);
63− cachedUrbitWallet.current = await urbitWalletFromTicket(
69− console.error(error);
70− return { [FORM_ERROR]: 'Unable to derive wallet from shards.' };
73 if (errors.ticket) {
60 if (errors.ticket) {
74 return errors;
61 return errors;
77− await timeout(100); // allow ui events to flush
79− // ticket
64+ ticket = values.ticket;
80− const _contracts = need.contracts(contracts);
65+ }
81− const point = patp2dec(values.point);
83− console.log('computing...');
67+ try {
69+ const _contracts = need.contracts(contracts);
70+ const point = patp2dec(values.point);
84− const urbitWallet = await urbitWalletFromTicket(
72+ cachedUrbitWallet.current = await urbitWalletFromTicket(
85− values.ticket,
75+ values.passphrase
78+ const [isOwner, isTransferProxy] = await Promise.all([
79+ azimuth.azimuth.isOwner(
82+ cachedUrbitWallet.current.ownership.keys.address
84+ azimuth.azimuth.isTransferProxy(
90− cachedUrbitWallet.current = urbitWallet;
87+ cachedUrbitWallet.current.ownership.keys.address
92− const [isOwner, isTransferProxy] = await Promise.all([
93− azimuth.azimuth.isOwner(
96− urbitWallet.ownership.keys.address
98− azimuth.azimuth.isTransferProxy(
101− urbitWallet.ownership.keys.address
105− if (!isOwner && !isTransferProxy) {
91+ if (!isOwner && !isTransferProxy) {
106− // notify the user, but allow login regardless
92+ // notify the user, but allow login regardless
107− // TODO: warnings
93+ // TODO: warnings
108− // 'This ticket is not the owner of or transfer proxy for this point.'
94+ // 'This ticket is not the owner of or transfer proxy for this point.'
111− console.error(error);
112− return { ticket: 'Unable to derive wallet from ticket.' };
97+ console.error(error);
99+ [FORM_ERROR]: `Unable to derive wallet from ${
100+ values.useShards ? 'shards' : 'ticket'
116 [contracts]
105 [contracts]