Browse Source

add account works somewhat

master
Julian Steinwachs 9 years ago
parent
commit
44931065da
  1. 4
      build/app-bundle.js
  2. 34
      build/twister-lib.js
  3. 4
      jsx/App.js

4
build/app-bundle.js

@ -186,7 +186,6 @@ App = React.createClass({displayName: "App",
key: this.state.accounts[i].name, key: this.state.accounts[i].name,
bsStyle: this.state.accounts[i].name==this.state.activeAccount ? 'primary' : 'default', bsStyle: this.state.accounts[i].name==this.state.activeAccount ? 'primary' : 'default',
onClick: this.switchAccount.bind(this,this.state.accounts[i].name), onClick: this.switchAccount.bind(this,this.state.accounts[i].name),
href: "javascript:void(0);",
eventKey: i eventKey: i
}, this.state.accounts[i].name) }, this.state.accounts[i].name)
); );
@ -233,7 +232,8 @@ App = React.createClass({displayName: "App",
React.createElement("br", null), React.createElement("br", null),
this.props.children && React.cloneElement(this.props.children, { this.props.children && React.cloneElement(this.props.children, {
accounts:this.state.accounts, accounts:this.state.accounts,
activeAccount:this.state.activeAccount activeAccount:this.state.activeAccount,
key:this.state.activeAccount
}) })
) )
) )

34
build/twister-lib.js

@ -30142,11 +30142,13 @@ TwisterAccount.prototype._signAndPublish = function(post_ori,cbfunc){
//console.log("new post msg after",status) //console.log("new post msg after",status)
if(status){
post.lastk = status.getId();
}
post.height = info.blocks-1; post.height = info.blocks-1;
post.n = thisAccount._name; post.n = thisAccount._name;
post.k = newid; post.k = newid;
post.lastk = status.getId();
post.time = Math.round(Date.now()/1000); post.time = Math.round(Date.now()/1000);
//console.log("new post will be",post) //console.log("new post will be",post)
@ -32929,13 +32931,13 @@ TwisterAvatar.prototype._queryAndDo = function (cbfunc) {
} else { } else {
thisResource._handleError({ /*thisResource._handleError({
message: "DHT resource is empty.", message: "DHT resource is empty.",
code: 32052 code: 32052
}) })*/
thisResource._revisionNumber=0; thisResource._revisionNumber=0;
thisResource._lastUpdate=Date.now()/1000; thisResource._lastUpdate=Date.now()/1000;
//cbfunc(thisResource); cbfunc(thisResource);
} }
@ -33693,13 +33695,13 @@ TwisterProfile.prototype._queryAndDo = function (cbfunc) {
} else { } else {
thisResource._handleError({ /*thisResource._handleError({
message: "DHT resource is empty.", message: "DHT resource is empty.",
code: 32052 code: 32052
}) })*/
thisResource._revisionNumber=0; thisResource._revisionNumber=0;
thisResource._lastUpdate=Date.now()/1000; thisResource._lastUpdate=Date.now()/1000;
//cbfunc(thisResource); cbfunc(thisResource);
} }
@ -34951,12 +34953,12 @@ TwisterStream.prototype._queryAndDo = function (cbfunc) {
} else { } else {
thisResource._handleError({ /*thisResource._handleError({
message: "DHT resource is empty.", message: "DHT resource is empty.",
code: 32052 code: 32052
}) })*/
thisResource._updateInProgress = false; thisResource._updateInProgress = false;
//cbfunc(null); cbfunc(null);
} }
@ -35135,12 +35137,12 @@ TwisterStream.prototype._doPost = function (id, cbfunc, querySettings) {
} else { } else {
thisResource._handleError({ /*thisResource._handleError({
message: "DHT resource is empty.", message: "DHT resource is empty.",
code: 32052 code: 32052
}) })*/
thisResource._updateInProgress = false; thisResource._updateInProgress = false;
//cbfunc(null); cbfunc(null);
} }
@ -35157,6 +35159,8 @@ TwisterStream.prototype._doPost = function (id, cbfunc, querySettings) {
} }
}else{
cbfunc(null);
} }
}; };
@ -35165,6 +35169,8 @@ TwisterStream.prototype._doUntil = function (cbfunc, querySettings) {
this._checkQueryAndDo(function doUntil(post){ this._checkQueryAndDo(function doUntil(post){
if(post){
var retVal = cbfunc(post); var retVal = cbfunc(post);
if(post.getLastId() && retVal!==false ) { if(post.getLastId() && retVal!==false ) {
@ -35173,6 +35179,8 @@ TwisterStream.prototype._doUntil = function (cbfunc, querySettings) {
} }
}
}, querySettings); }, querySettings);
} }

4
jsx/App.js

@ -185,7 +185,6 @@ App = React.createClass({
key={this.state.accounts[i].name} key={this.state.accounts[i].name}
bsStyle={this.state.accounts[i].name==this.state.activeAccount ? 'primary' : 'default'} bsStyle={this.state.accounts[i].name==this.state.activeAccount ? 'primary' : 'default'}
onClick={this.switchAccount.bind(this,this.state.accounts[i].name)} onClick={this.switchAccount.bind(this,this.state.accounts[i].name)}
href="javascript:void(0);"
eventKey={i} eventKey={i}
>{this.state.accounts[i].name}</MenuItem> >{this.state.accounts[i].name}</MenuItem>
); );
@ -232,7 +231,8 @@ App = React.createClass({
<br/> <br/>
{this.props.children && React.cloneElement(this.props.children, { {this.props.children && React.cloneElement(this.props.children, {
accounts:this.state.accounts, accounts:this.state.accounts,
activeAccount:this.state.activeAccount activeAccount:this.state.activeAccount,
key:this.state.activeAccount
})} })}
</Col> </Col>
</Row> </Row>

Loading…
Cancel
Save