Browse Source

fixed personals histories

master
nicolas-arnaud 2 years ago
parent
commit
0da5988b7d
  1. 1
      back/volume/src/chat/entity/channel.entity.ts
  2. 11
      front/volume/src/App.svelte
  3. 2
      front/volume/src/components/Profile.svelte

1
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)

11
front/volume/src/App.svelte

@ -61,7 +61,7 @@
setAppState(APPSTATE.PROFILE);
}
let profileUsername: string;
let profileUsername: string = "";
async function openIdProfile(event: CustomEvent<string>) {
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<ChannelsType> = [];
let selectedChannel: ChannelsType;
const handleSelectChannel = (channel: ChannelsType) => {
selectedChannel = channel;
@ -177,7 +172,7 @@
{/if}
{#if appState === APPSTATE.PROFILE}
<div on:click={resetAppState} on:keydown={resetAppState}>
<Profile on:view-history={openIdHistory} />
<Profile on:view-history={() => setAppState(APPSTATE.HISTORY_ID)} />
</div>
{/if}
{#if appState === APPSTATE.PROFILE_ID}
@ -187,7 +182,7 @@
on:keydown={() =>
setAppState(APPSTATE.CHANNELS + "#" + selectedChannel.name)}
>
<Profile username={profileUsername} on:view-history={openIdHistory} />
<Profile username={profileUsername} on:view-history={() => setAppState(APPSTATE.HISTORY_ID)} />
</div>
{/if}

2
front/volume/src/components/Profile.svelte

@ -96,7 +96,7 @@
</div>
<div class="profile-body">
<p>
<button on:click={() => dispatch("view-history", user.ftId)}
<button on:click={() => dispatch("view-history", user.username)}
>View History</button
>
</p>

Loading…
Cancel
Save