Skip to content

Commit

Permalink
Merge pull request #8 from daostack/modal-service-nesting-fix-2
Browse files Browse the repository at this point in the history
Fix modal service nesting ; remove unnecessary console log
  • Loading branch information
roienatan authored Nov 9, 2020
2 parents 3c151ec + 525d38e commit 3e29657
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/arc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ export async function initializeArc(provider?: Web3Provider): Promise<boolean> {
return (count !== 10);
},
delay: () => {
console.log(Math.floor(Math.random() * (30000 - 5000 + 1) + 5000));
// This will give a random delay between retries between the range of 5 to 30 seconds.
return Math.floor(Math.random() * (30000 - 5000 + 1) + 5000);
},
Expand Down
12 changes: 6 additions & 6 deletions src/lib/proposalUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,27 +80,27 @@ export function restoreModalFormEntries(name: string): { [key: string]: any } {
if (valuesString) {
sessionStorage.removeItem(formValuesKey(name));
try {
const values = JSON.parse(valuesString);

const processValue = (key: string): void => {
const rootValues = JSON.parse(valuesString);
const processValue = (values: { [key: string]: any }, key: string): void => {
const value = values[key];
// Moment interprets something like "100" as a date
if (typeof value === "string" && isNaN(value as any)) {
const date = moment(value);
if (date?.isValid()) {
values[key] = date;
}
} else if (typeof value === "object") {
Object.keys(value).map((key: string) => processValue(value, key));
}
};
/**
* convert ISO date/time strings to Moment object
*/
Object.keys(values).map(processValue);
return values;
Object.keys(rootValues).map((key: string) => processValue(rootValues, key));
return rootValues;
}
// eslint-disable-next-line no-empty
catch { }
}

return {};
}

0 comments on commit 3e29657

Please sign in to comment.