Skip to content
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

Only show sort buttons if there is more than 1 image in the album #573

Closed
oparoz opened this issue Mar 9, 2016 · 11 comments
Closed

Only show sort buttons if there is more than 1 image in the album #573

oparoz opened this issue Mar 9, 2016 · 11 comments

Comments

@oparoz
Copy link
Contributor

oparoz commented Mar 9, 2016

Feature request

User type: All

User level: All

Description

It doesn't make sense to show sort buttons if there is only a single image in the album

Benefit / value

  • Make the app look cleverer
  • Give a task to someone who wants to learn more about the inner-working of the app

Risk / caveats

Some users get confused when the interface changes

@virajparimi
Copy link
Contributor

I would like too work on this one. Will get back to you with progress.

@virajparimi
Copy link
Contributor

@oparoz I have been able to solve the problem when there is only one image, but I have one doubt. Suppose that we have only one folder in the gallery then also should the sort buttons appear?

@oparoz
Copy link
Contributor Author

oparoz commented Mar 10, 2016

@viraj96 - It's the same problem. The buttons should not show when there is only one album

@oparoz
Copy link
Contributor Author

oparoz commented Mar 13, 2016

There is a regression:

  1. Add pictures to a folder
  2. Create a sub-folder
  3. Enter the sub-folder
  4. Add a .nomedia file
  5. Switch to Gallery
  6. Press on the parent folder in the breadcrumb
TypeError: album.images is undefined  in galleryview.js

@viraj96 - You need to make sure these have been defined before trying to use them.

@oparoz oparoz reopened this Mar 13, 2016
@virajparimi
Copy link
Contributor

Ok. Will look into it and fix it. By the way, how do I talk to you about gsoc - 2016 program, like where are you available?

@oparoz
Copy link
Contributor Author

oparoz commented Mar 13, 2016

I've added my contact details to the Gallery wiki

@virajparimi
Copy link
Contributor

@oparoz I am not getting such error but I am getting something like this.
owncloud_1
Are you referring to the same thing? Else could we just put something like if(typeof album.image!==undefined) then do stuff else don't use that.

@oparoz
Copy link
Contributor Author

oparoz commented Mar 14, 2016

I think you've missed a step, the error shows up when you click on the parent folder.
But yes, the fix would be the same and please use underscore to check if it's undefined.
Thanks!

@virajparimi
Copy link
Contributor

@oparoz Some doubts. Can album.subAlbums also be undefined ever? And suppose if it is, what would be our sum if both album.images and album.subAlbums both become undefined? Would it be 0.

@oparoz
Copy link
Contributor Author

oparoz commented Mar 14, 2016

Can album.subAlbums also be undefined ever?

I think so, you need to check the flow of the app. When does it make that test and when does it get a list of images.
It could be that there is a very similar problem when opening gallery for the first time and it's empty.

What would be our sum if both album.images and album.subAlbums both become undefined?

Just make your variable take the value 0 if it's undefined, that way you can still make the addition.

@oparoz
Copy link
Contributor Author

oparoz commented Mar 15, 2016

The bug is probably unrelated, so I will close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@oparoz @virajparimi and others