-
Notifications
You must be signed in to change notification settings - Fork 360
Chore: unpromisify localStorage #3181
Conversation
|
CLA Assistant Lite All Contributors have signed the CLA. |
| setConsentReceived(true) | ||
| } else { | ||
| setConsentReceived(false) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦
| const checkIfSafeIsPendingToBeCreated = async (): Promise<void> => { | ||
| setIsLoading(true) | ||
| const safePendingToBeCreated = (await loadFromStorage(SAFE_PENDING_CREATION_STORAGE_KEY)) as CreateSafeFormValues | ||
| const safePendingToBeCreated = await Promise.resolve( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the promise completely here was breaking the CreateSafePage tests for a mysterious reason, so I kept this for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a @TODO: comment?
ESLint Summary View Full Report
Report generated by eslint-plus-action |
| const checkIfSafeIsPendingToBeCreated = async (): Promise<void> => { | ||
| setIsLoading(true) | ||
| const safePendingToBeCreated = (await loadFromStorage(SAFE_PENDING_CREATION_STORAGE_KEY)) as CreateSafeFormValues | ||
| const safePendingToBeCreated = await Promise.resolve( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a @TODO: comment?
| const name = STORAGE_KEYS[id] || id | ||
| // Legacy ImmortalDB prefix | ||
| // @TODO: migrate it | ||
| return `_immortal|v2_${name}__` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll be forever haunted by this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restored the comment. I was actually working on a migration PR but then decided to get rid of async-await first.
Deployment links
|
|
No need to test this. (Famous last words) |
What it solves
According to my academic research (a quick Google search), there's no performance benefit in promisifying localStorage calls, so I've removed all of the related async-awaits.