Created
July 6, 2015 20:25
-
-
Save TheIronDev/9a2466890e6b0836d395 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -61,6 +61,9 @@ module.exports = React.createClass({ | |
}, | |
getInitialState() { | |
+ | |
+ let previousTransactions = localStorage.previousTransactions ? JSON.parse(localStorage.previousTransactions) : []; | |
+ | |
return { | |
// Server-Side calls will populate these | |
@@ -69,7 +72,7 @@ module.exports = React.createClass({ | |
// Not sure how we will fill these out yet | |
amounts: mockAmount, | |
- previousTransactions: mockTransactions, | |
+ previousTransactions: previousTransactions, | |
// UI related classes | |
recipientStatus: '', | |
@@ -220,6 +223,10 @@ module.exports = React.createClass({ | |
showSuccess: true | |
}); | |
+ let previousTransactions = this.state.previousTransactions || []; | |
+ previousTransactions.push(mockTransactions[0]); | |
+ localStorage.setItem('previousTransactions', JSON.stringify(previousTransactions)); | |
+ | |
if (callback) { | |
callback(data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment