-
Notifications
You must be signed in to change notification settings - Fork 17
[MPP-3063] Reduce panel load time #498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…d using local storage for masks
…unction from larger mask list builder function
44fd864
to
3fcffb5
Compare
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.
Self-review. Came up with a few TODOs!
// Remove loading state | ||
document.body.classList.remove("is-loading"); |
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.
Context: Moved this to the end of the buildMasksList()
function. Previously, we were removing the loading state too early.
|
||
// Generate and append each mask item to the mask list | ||
masks.forEach( mask => { | ||
const maskListItem = popup.panel.masks.utilities.buildMaskListItem(mask); |
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.
Context: This function was getting really big. Broke out the buildMaskListItem
iteration to make it easier to read.
// TODO: Add toggle button back | ||
// maskListItemAddressActions.append(maskListItemToggleButton); |
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.
Disregard this TODO. It is part of #473
Summary
This PR reduces the load time when a user is logged in and opens the panels to view their masks.
This fixes:
TODO
Build initial masks lists on local (stale) dateDisregarding for nowUpdate masks accordingly when API call finishes loading (add new masks, update status of other masks)Testing
For context, compare these actions to the production release with the same account.
$ npm run config:prod
)Screenshots
TBD