Skip to content

Commit

Permalink
Merge pull request #516 from openworklabs/dev
Browse files Browse the repository at this point in the history
Release v1.1.1
  • Loading branch information
Schwartz10 authored Sep 12, 2020
2 parents e2ca474 + 81b008e commit 8fc3271
Show file tree
Hide file tree
Showing 6 changed files with 264 additions and 198 deletions.
10 changes: 9 additions & 1 deletion lib/WasmLoader.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
import React, { useContext, createContext } from 'react'
import Router from 'next/router'
import dynamic from 'next/dynamic'
import { node } from 'prop-types'
import prepareSubproviders from '../WalletProvider/prepareSubproviders'
import reportError from '../utils/reportError'

export const WasmContext = createContext({ loaded: false })

// Loads the wasm asyncronously and exposes it via a hook
export const WasmLoader = dynamic({
ssr: false,
loader: async () => {
const rustModule = await import('@zondax/filecoin-signing-tools')
let rustModule = {}
try {
rustModule = await import('@zondax/filecoin-signing-tools')
} catch (err) {
reportError('lib/WasmLoader:1', false)
Router.push('/error/use-desktop-browser')
}
const walletSubproviders = prepareSubproviders(rustModule)
const WasmProvider = ({ children }) => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/useDesktopBrowser.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export default () => {
useEffect(() => {
const onMobileBrowser = isMobileOrTableBrowser()
if (onMobileBrowser) replace('/error/use-desktop-browser')
}, [replace])
})
}
Loading

0 comments on commit 8fc3271

Please sign in to comment.