From 0da5988b7d53d7c7b2378ad62feaab3565421f3d Mon Sep 17 00:00:00 2001 From: nicolas-arnaud Date: Wed, 15 Mar 2023 10:50:34 +0100 Subject: [PATCH] fixed personals histories --- back/volume/src/chat/entity/channel.entity.ts | 1 + front/volume/src/App.svelte | 11 +++-------- front/volume/src/components/Profile.svelte | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/back/volume/src/chat/entity/channel.entity.ts b/back/volume/src/chat/entity/channel.entity.ts index 475e0a9..6ab26bf 100644 --- a/back/volume/src/chat/entity/channel.entity.ts +++ b/back/volume/src/chat/entity/channel.entity.ts @@ -30,6 +30,7 @@ export default class Channel { @BeforeInsert() async hashPassword () { + if (this.password === '') return this.password = await bcrypt.hash( this.password, Number(process.env.HASH_SALT) diff --git a/front/volume/src/App.svelte b/front/volume/src/App.svelte index 083e860..cd979b8 100644 --- a/front/volume/src/App.svelte +++ b/front/volume/src/App.svelte @@ -61,7 +61,7 @@ setAppState(APPSTATE.PROFILE); } - let profileUsername: string; + let profileUsername: string = ""; async function openIdProfile(event: CustomEvent) { profileUsername = event.detail; setAppState(APPSTATE.PROFILE_ID); @@ -71,10 +71,6 @@ setAppState(APPSTATE.HISTORY); } - async function openIdHistory() { - setAppState(APPSTATE.HISTORY_ID); - } - async function clickFriends() { setAppState(APPSTATE.FRIENDS); } @@ -86,7 +82,6 @@ function clickChannels() { setAppState(APPSTATE.CHANNELS); } - let channels: Array = []; let selectedChannel: ChannelsType; const handleSelectChannel = (channel: ChannelsType) => { selectedChannel = channel; @@ -177,7 +172,7 @@ {/if} {#if appState === APPSTATE.PROFILE}
- + setAppState(APPSTATE.HISTORY_ID)} />
{/if} {#if appState === APPSTATE.PROFILE_ID} @@ -187,7 +182,7 @@ on:keydown={() => setAppState(APPSTATE.CHANNELS + "#" + selectedChannel.name)} > - + setAppState(APPSTATE.HISTORY_ID)} /> {/if} diff --git a/front/volume/src/components/Profile.svelte b/front/volume/src/components/Profile.svelte index 8a9a71b..a8cdddd 100644 --- a/front/volume/src/components/Profile.svelte +++ b/front/volume/src/components/Profile.svelte @@ -96,7 +96,7 @@

-