-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
refactor(web): asset grid state #3513
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
6a810b9
to
c3b0b86
Compare
c3b0b86
to
97c8f89
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.
Brilliant! I'm a big fan of your refactoring PRs.
Looks like handleSelectAssets
doesn't work as expected:
- Open photos page and select one asset
- Click on the scrollbar somewhere near the bottom and Shift-select another asset
Assets got selected, but addGroupToMultiselectGroup
was not called for intermediate date groups
return nextBucket.assets[0]?.id || null; | ||
} | ||
|
||
private emit(recalculate: boolean) { |
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.
Is this for updating the state?
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.
Yes. It updates the svelte store.
getAdjacentAsset, | ||
updateAsset, | ||
subscribe, | ||
init: store.init.bind(store), |
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.
Can you help explain what does the bind
method do here?
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.
The this
in a method is "whatever object called the method". It's kind of complicated, but basically
on:click={obj.foo}
on:click={() => obj.foo()}
Have different values for this
. Only the second one would work.
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.
Bind makes a method always use the same this
value, which is passed into bind
.
In this PR:
Tested Scenarios: