Don't cache contribution details in browser storage

This commit is contained in:
Râu Cao
2022-11-11 16:28:59 +01:00
parent e1780109aa
commit 0f8d7d84ca
2 changed files with 20 additions and 5 deletions
+6 -2
View File
@@ -1,4 +1,4 @@
export default function processContributionData(data) {
export default function processContributionData(data, options={}) {
const processed = {}
if (data.confirmedAtBlock && (typeof data.confirmedAtBlock.toNumber === 'function')) {
@@ -9,12 +9,16 @@ export default function processContributionData(data) {
const otherProperties = [
'id', 'contributorId', 'amount', 'vetoed', 'ipfsHash', 'kind',
'description', 'details', 'url', 'date', 'time', 'pendingTx'
'description', 'url', 'date', 'time', 'pendingTx'
];
otherProperties.forEach(prop => {
processed[prop] = data[prop];
});
if (options.includeDetails) {
processed.details = data.details;
}
return processed;
}