randomize avatar for same names
This commit is contained in:
@@ -81,7 +81,8 @@ class Messaging {
|
||||
|
||||
initLocalStates() {
|
||||
this.username = getLocalStorage(KEY_USERNAME) || generateUsername();
|
||||
this.imgUsernameAvatar.src = getLocalStorage(KEY_AVATAR) || generateAvatar(this.username);
|
||||
this.imgUsernameAvatar.src =
|
||||
getLocalStorage(KEY_AVATAR) || generateAvatar(`${this.username}${Date.now()}`);
|
||||
this.updateUsernameFields(this.username);
|
||||
|
||||
this.chatDisplayed = getLocalStorage(KEY_CHAT_DISPLAYED) || false;
|
||||
@@ -149,7 +150,7 @@ class Messaging {
|
||||
if (newValue) {
|
||||
this.username = newValue;
|
||||
this.updateUsernameFields(newValue);
|
||||
this.imgUsernameAvatar.src = generateAvatar(newValue);
|
||||
this.imgUsernameAvatar.src = generateAvatar(`${newValue}${Date.now()}`);
|
||||
setLocalStorage(KEY_USERNAME, newValue);
|
||||
setLocalStorage(KEY_AVATAR, this.imgUsernameAvatar.src);
|
||||
}
|
||||
|
||||
@@ -60,7 +60,6 @@ function setupPlayerEventHandlers() {
|
||||
|
||||
function restartPlayer() {
|
||||
try {
|
||||
console.log('restarting', player.src())
|
||||
const player = videojs(VIDEO_ID);
|
||||
player.pause();
|
||||
player.src(player.src()); // Reload the same video
|
||||
|
||||
Reference in New Issue
Block a user