Check for updated proposals length
This commit is contained in:
parent
c106722c5b
commit
76affefad9
@ -249,10 +249,12 @@ export default class Services {
|
|||||||
// Check if the newly updated process reveals some new information
|
// Check if the newly updated process reveals some new information
|
||||||
try {
|
try {
|
||||||
const proposals: string[] = this.sdkClient.get_update_proposals(processCommitment);
|
const proposals: string[] = this.sdkClient.get_update_proposals(processCommitment);
|
||||||
const actual_proposal = JSON.parse(proposals[0]); // just hacky way to solve redundant info for now
|
if (proposals && proposals.length != 0) {
|
||||||
|
const actual_proposal = JSON.parse(proposals[0]); // We just don't acknowledge concurrent proposals for now
|
||||||
console.info(actual_proposal);
|
console.info(actual_proposal);
|
||||||
let router = await Routing.getInstance();
|
let router = await Routing.getInstance();
|
||||||
router.openConfirmationModal(actual_proposal, processCommitment);
|
router.openConfirmationModal(actual_proposal, processCommitment);
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
@ -260,7 +262,7 @@ export default class Services {
|
|||||||
|
|
||||||
if(apiReturn.updated_cached_msg && apiReturn.updated_cached_msg.length) {
|
if(apiReturn.updated_cached_msg && apiReturn.updated_cached_msg.length) {
|
||||||
apiReturn.updated_cached_msg.forEach((msg, index) => {
|
apiReturn.updated_cached_msg.forEach((msg, index) => {
|
||||||
console.debug(`CachedMessage ${index}:`, msg);
|
// console.debug(`CachedMessage ${index}:`, msg);
|
||||||
// Save the message to local storage
|
// Save the message to local storage
|
||||||
localStorage.setItem(msg.id.toString(), JSON.stringify(msg));
|
localStorage.setItem(msg.id.toString(), JSON.stringify(msg));
|
||||||
});
|
});
|
||||||
@ -271,7 +273,7 @@ export default class Services {
|
|||||||
await this.sendCommitMessage(JSON.stringify(commit));
|
await this.sendCommitMessage(JSON.stringify(commit));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (apiReturn.new_tx_to_send) {
|
if (apiReturn.new_tx_to_send && apiReturn.new_tx_to_send.transaction.length != 0) {
|
||||||
await this.sendNewTxMessage(JSON.stringify(apiReturn.new_tx_to_send))
|
await this.sendNewTxMessage(JSON.stringify(apiReturn.new_tx_to_send))
|
||||||
}
|
}
|
||||||
}, 0)
|
}, 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user