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