Skip to content

Instantly share code, notes, and snippets.

@ryanpedersen42
Last active December 27, 2019 19:33
Show Gist options
  • Select an option

  • Save ryanpedersen42/c3f2694284e0bb8f7b9e7d9208b3b128 to your computer and use it in GitHub Desktop.

Select an option

Save ryanpedersen42/c3f2694284e0bb8f7b9e7d9208b3b128 to your computer and use it in GitHub Desktop.
auth3Box = async () => {
const { user, logUserIn, history, setUserProfile, setBox, setDappSpace } = this.props;
const box = await Box.openBox(user.ethAddress, window.ethereum, {});
await new Promise((resolve, reject) => box.onSyncDone(resolve));
const dappSpace = await box.openSpace('catRoulette');
const userProfile = await Box.getProfile(user.ethAddress)
await setBox(box)
await setDappSpace(dappSpace)
await setUserProfile(userProfile)
await logUserIn()
history.push('/main')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment