amitg87 / asana-chrome-plugin

AsanaNG - NextGen Asana Chrome Plugin
https://chrome.google.com/webstore/detail/asanang-unofficial-asana/mcfgjehdbegcfjeecdgdpjlmfbeamgdd
MIT License
18 stars 7 forks source link

For users without a profile photo, the photo of the previously selected user is used #24

Closed ShunSakurai closed 7 years ago

ShunSakurai commented 7 years ago

Steps to reproduce

  1. Select a user with a profile photo me

  2. Select a user without a profile photo not me

Cause

I think the following code in createTask.html file defines the selection of user photo:

<img class="img-circle profile-img profile-img-sm"
    data-ng-src="{{$select.selected.photo.image_21x21}}"
    src="../img/nopicture.png">

Below is my assumption; please correct it if it's wrong: For the first selection (or when "Default Assignee - Me" option is on), if the selected user doesn't have a photo, data-ng-src is null, so it falls back to src "../img/nopicture.png". Once the user with a photo is selected, data-ng-src is not null anymore. Then when we select another user without a photo, data-ng-src is not updated and the previous user's photo is still used.

Solution

Suggestion is to create createTaskCtrl.onUserSelected($item, $model) function which refreshes the profile photo every time a user is selected and add it to on-select. However, this is not a serious issue so you might want to keep the code simple rather than fixing this. What do you think?