-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
fix(web): empty album stored #9771
fix(web): empty album stored #9771
Conversation
@@ -6,7 +6,7 @@ import type { PageLoad } from './$types'; | |||
export const load = (async ({ params }) => { | |||
await authenticate(); | |||
const [album, asset] = await Promise.all([ | |||
getAlbumInfo({ id: params.albumId, withoutAssets: true }), | |||
getAlbumInfo({ id: params.albumId, withoutAssets: 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.
This is necessary as otherwise the albums with assets get deleted when clicking the back button.
Not sure if this is a performance problem/how expensive the query is in the backend.
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.
It is and it is quite expensive. Album info should have the asset count in it though.
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.
Works perfectly, no idea why I missed the property, sorry and thx.
web/src/routes/(user)/albums/[albumId=id]/[[photos=photos]]/[[assetId=id]]/+page.svelte
Outdated
Show resolved
Hide resolved
58904f1
to
feec0c4
Compare
web/src/routes/(user)/albums/[albumId=id]/[[photos=photos]]/[[assetId=id]]/+page.svelte
Outdated
Show resolved
Hide resolved
6b826db
to
bf5ceaa
Compare
4f56d46
to
d90552a
Compare
d90552a
to
e7a99bb
Compare
I was annoyed by #9657 so I fixed it on may local version.
The idea is to remove and empty album (without assets) when navigating back (clicking the close button) from the album create page instead of cleaning up when navigating to the albums page.
However I'm just starting to get familiar with the code, so I don't know if there are any side effects I'm not aware of...
The alternative would be to do the same cleanup when e.g. when adding a a photo to an album (in the "photos" section).
The advantage of doing it on closing is that it only needs to done once and it also avoids the flickering when opening the "albums" section (the empty album is visible just before it is deleted).
Please let me know if it is useful for you.