File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " bnc-onboard" ,
3
- "version" : " 1.26.1-0.1 .0" ,
3
+ "version" : " 1.26.1-0.2 .0" ,
4
4
"description" : " Onboard users to web3 by allowing them to select a wallet, get that wallet ready to transact and have access to synced wallet state." ,
5
5
"keywords" : [
6
6
" ethereum" ,
Original file line number Diff line number Diff line change @@ -36,8 +36,27 @@ import initializeModules from './modules'
36
36
let onboard : any
37
37
38
38
function init ( initialization : Initialization ) : API {
39
+ if ( typeof window === 'undefined' ) {
40
+ console . warn (
41
+ 'Onboard.js must be run in a browser environment. If you are utilizing server side rendering you can ignore this warning.'
42
+ )
43
+
44
+ const stubbedAPI = {
45
+ walletSelect : ( ) => Promise . resolve ( false ) ,
46
+ walletCheck : ( ) => Promise . resolve ( false ) ,
47
+ walletReset : ( ) => { } ,
48
+ config : ( ) => { } ,
49
+ getState : ( ) => get ( state ) ,
50
+ accountSelect : ( ) => Promise . resolve ( false )
51
+ }
52
+
53
+ return stubbedAPI
54
+ }
55
+
39
56
if ( onboard ) {
40
- console . warn ( 'onboard has already been initialized' )
57
+ console . warn (
58
+ 'Initializing Onboard and destroying previously initialized instance.'
59
+ )
41
60
onboard . $destroy ( )
42
61
}
43
62
You can’t perform that action at this time.
0 commit comments