Use an implicit attribute to store whether the hint was displayed or not

As it is a boolean flag just set once and only needed when the current
user is a guest an implicit attribute added dynamically is now used
instead of an explicit attribute; "_" was prepended to the name too to
mark it as "private".

Note that in the embedded Talk UI there was no explicit attribute, so
the condition would have never passed and the hint would have never been
shown. However, as the embedded Talk UI is currently not used with
guests it was not an issue.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez 2019-02-19 12:24:29 +01:00
Родитель a9a1125b26
Коммит c9299b9b81
2 изменённых файлов: 4 добавлений и 5 удалений

Просмотреть файл

@ -76,7 +76,6 @@
_participants: null,
/** @property {OCA.SpreedMe.Views.ParticipantView} _participantsView */
_participantsView: null,
displayedGuestNameHint: false,
fullscreenDisabled: true,
_searchTerm: '',
guestNick: null,
@ -781,9 +780,9 @@
var guestName = localStorage.getItem("nick");
this._localVideoView.setAvatar(userId, guestName);
if (!userId && this.displayedGuestNameHint === false) {
if (!userId && !this._displayedGuestNameHint) {
OC.Notification.showTemporary(t('spreed', 'Set your name in the chat window so other participants can identify you better.'));
this.displayedGuestNameHint = true;
this._displayedGuestNameHint = true;
}
avatarContainer.removeClass('hidden');

Просмотреть файл

@ -226,9 +226,9 @@
var guestName = localStorage.getItem("nick");
this._localVideoView.setAvatar(userId, guestName);
if (!userId && this.displayedGuestNameHint === false) {
if (!userId && !this._displayedGuestNameHint) {
OC.Notification.showTemporary(t('spreed', 'Set your name in the chat window so other participants can identify you better.'));
this.displayedGuestNameHint = true;
this._displayedGuestNameHint = true;
}
avatarContainer.removeClass('hidden');