Skip to content

Commit

Permalink
Merge pull request #125 from frontend-park-mail-ru/fix-deploy
Browse files Browse the repository at this point in the history
user editing hotfix
  • Loading branch information
daronenko authored Dec 21, 2024
2 parents b736e94 + 1ffba15 commit 05fd305
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
4 changes: 4 additions & 0 deletions src/entities/user/model/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ class UserStore {
Storage.save('user', this.storage.user);

eventBus.emit('updateAvatarSuccess', this.storage.user);
eventBus.emit('renderHeader');
eventBus.emit('navigate', `/profiles/${this.storage.user.username}`);
break;

default:
Expand Down Expand Up @@ -257,6 +259,8 @@ class UserStore {
Storage.save('user', this.storage.user);

eventBus.emit('updateUserSuccess', this.storage.user);
eventBus.emit('renderHeader');
eventBus.emit('navigate', `/profiles/${this.storage.user.username}`);
break;

default:
Expand Down
1 change: 0 additions & 1 deletion src/pages/more-playlists/ui/morePlaylists.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export class MorePlaylistsPage {
this.type = params["type"];
this.entity = params["entity"];
this.id = params["id"];
console.log(params);
}

async render() {
Expand Down
1 change: 0 additions & 1 deletion src/widgets/createPlaylist/ui/createPlaylist.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export class CreatePlaylistModal {
}

if (this.onClose) {
console.log('this.onClose');
this.onClose();
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/widgets/editUser/ui/editUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@ export class EditUserView {
}

handleSuccess() {
const user = userStore.storage.user;
eventBus.emit("navigate", `/profiles/${user.username}`);
}
// eventBus.emit("navigate", `/profiles/${userStore.storage.user.username}`);
}

handleError(error) {
document.querySelector("#edit-user__username-error").querySelector('h4').textContent = "";
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/imageUploader/ui/imageUploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class ImageUploaderView {
if (this.onSuccessEvent) {
eventBus.on(this.onSuccessEvent, () => {
if (this.navigateUrl) {
window.location.href = this.navigateUrl;
// window.location.href = this.navigateUrl;
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/sideMenu/ui/sideMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as styles from "./sideMenu.scss"

export class SideMenu {
constructor() {
this.root = document.querySelector("#root"); // Ensure this targets the correct container
this.root = document.querySelector("#root");
}

render() {
Expand All @@ -15,7 +15,6 @@ export class SideMenu {

const user = userStore.storage.user;

// Create and append the side menu
this.sideMenuElement = document.createElement("div");
this.sideMenuElement.classList.add(`${styles["side_menu"]}`);
this.sideMenuElement.innerHTML = template({ styles, user });
Expand Down Expand Up @@ -93,6 +92,7 @@ export class SideMenu {
};

onSignOutSuccess = () => {
console.log('onSignOutSuccess');
this.render();
};

Expand Down

0 comments on commit 05fd305

Please sign in to comment.