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

Vue avatars in list #641

Merged
merged 9 commits into from
Sep 26, 2018
Merged

Vue avatars in list #641

merged 9 commits into from
Sep 26, 2018

Conversation

sleepypioneer
Copy link
Member

Fix #604 Proposed code for adding avatars in list without needing to check contact.photo using contact.url?photo.

I condensed the two divs and set them to return values based on if an url was returned or not.

I removed the filter as it was simpler to return this.contact.displayName.charAt(0)or '' for the initial value.

@sleepypioneer sleepypioneer added 3. to review Waiting for reviews 2. developing Work in progress vue labels Sep 25, 2018
@sleepypioneer sleepypioneer added this to the 3.0.0 milestone Sep 25, 2018
@sleepypioneer sleepypioneer self-assigned this Sep 25, 2018
@@ -48,6 +45,16 @@ export default {
} catch (e) {
return 'grey'
}
},
avatarUrl() {
return 'url(' + this.contact.url + '?photo' + ')'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small tip, with latest javascript you can do

`url(${this.contact.url}?photo)`

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool very nice, anything else here to change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll rebase your branch in a second :)

@skjnldsv
Copy link
Member

skjnldsv commented Sep 25, 2018

  • hum, I get no letters :/
    capture d ecran_2018-09-25_18-35-06
  • background-size needs a fix
    capture d ecran_2018-09-25_18-37-41

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Copy link
Member

@skjnldsv skjnldsv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I finally wanted to try something, so I changed the behaviour a bit :)
I'll let you take a look tomorrow!

return `url(${this.contact.url}?photo)`
},
initial() {
if (this.avatarUrl) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A contact always have an url. You cannot assume the contact have a picture or not.
If a contact does NOT have an url, that means it's a local contact (present on the store only and not created on the server yet) that have not yet been pushed to the server. So in that case, yes we can assume it doesn't have an url. Though I'll suggest checking the contact.dav property to check if this is a local contact or not.

@skjnldsv
Copy link
Member

capture d ecran_2018-09-25_18-55-08

@skjnldsv skjnldsv removed the 2. developing Work in progress label Sep 25, 2018
@sleepypioneer
Copy link
Member Author

Nice work 🎖 sorry for the messy errors.

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

Successfully merging this pull request may close these issues.

2 participants