mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-03 09:24:25 +00:00
chore(templates): replace blockchain.connect by onReady
This commit is contained in:
parent
7eceaf6c0a
commit
4eee4dfc65
@ -1,11 +1,10 @@
|
||||
import EmbarkJS from 'Embark/EmbarkJS';
|
||||
import config from '../../embarkArtifacts/config/blockchain.json';
|
||||
|
||||
// import your contracts
|
||||
// e.g if you have a contract named SimpleStorage:
|
||||
//import SimpleStorage from 'Embark/contracts/SimpleStorage';
|
||||
|
||||
|
||||
EmbarkJS.Blockchain.connect(config, (err) => {
|
||||
EmbarkJS.onReady((err) => {
|
||||
// You can execute contract calls after the connection
|
||||
});
|
||||
|
@ -7,7 +7,6 @@ import Blockchain from './components/blockchain';
|
||||
import Whisper from './components/whisper';
|
||||
import Storage from './components/storage';
|
||||
import ENS from './components/ens';
|
||||
import config from '../embarkArtifacts/config/blockchain';
|
||||
|
||||
import './dapp.css';
|
||||
|
||||
@ -28,7 +27,7 @@ class App extends React.Component {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
EmbarkJS.Blockchain.connect(config, (err) => {
|
||||
EmbarkJS.onReady((err) => {
|
||||
this.setState({blockchainEnabled: true});
|
||||
if (err) {
|
||||
// If err is not null then it means something went wrong connecting to ethereum
|
||||
|
@ -2,7 +2,6 @@
|
||||
import React from 'react';
|
||||
import EmbarkJS from 'Embark/EmbarkJS';
|
||||
import {SimpleStorage, Test, SimpleStorageTest} from '../../embarkArtifacts/contracts';
|
||||
import config from '../../embarkArtifacts/config/blockchain';
|
||||
|
||||
window.SimpleStorageTest = SimpleStorageTest;
|
||||
|
||||
@ -34,7 +33,7 @@ var addToLog = function(id, txt) {
|
||||
// Blockchain example
|
||||
// ===========================
|
||||
$(document).ready(function() {
|
||||
EmbarkJS.Blockchain.connect(config, (err) => {
|
||||
EmbarkJS.onReady((err) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user