Add experimental multiuserroom
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
import { capitalize } from "src/ts/util";
|
||||
import { longpress } from "src/ts/gui/longtouch";
|
||||
import { ColorSchemeTypeStore } from "src/ts/gui/colorscheme";
|
||||
import { ConnectionOpenStore } from "src/ts/sync/multiuser";
|
||||
export let message = ''
|
||||
export let name = ''
|
||||
export let largePortrait = false
|
||||
@@ -202,20 +203,22 @@
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
<button class={"ml-2 hover:text-green-500 transition-colors "+(editMode?'text-green-400':'')} on:click={() => {
|
||||
if(!editMode){
|
||||
editMode = true
|
||||
}
|
||||
else{
|
||||
editMode = false
|
||||
edit()
|
||||
}
|
||||
}}>
|
||||
<PencilIcon size={20}/>
|
||||
</button>
|
||||
<button class="ml-2 hover:text-green-500 transition-colors" on:click={(e) => rm(e, false)} use:longpress={(e) => rm(e, true)}>
|
||||
<TrashIcon size={20}/>
|
||||
</button>
|
||||
{#if !$ConnectionOpenStore}
|
||||
<button class={"ml-2 hover:text-green-500 transition-colors "+(editMode?'text-green-400':'')} on:click={() => {
|
||||
if(!editMode){
|
||||
editMode = true
|
||||
}
|
||||
else{
|
||||
editMode = false
|
||||
edit()
|
||||
}
|
||||
}}>
|
||||
<PencilIcon size={20}/>
|
||||
</button>
|
||||
<button class="ml-2 hover:text-green-500 transition-colors" on:click={(e) => rm(e, false)} use:longpress={(e) => rm(e, true)}>
|
||||
<TrashIcon size={20}/>
|
||||
</button>
|
||||
{/if}
|
||||
{/if}
|
||||
{#if $DataBase.translator !== '' && !blankMessage}
|
||||
<button class={"ml-2 cursor-pointer hover:text-green-500 transition-colors " + (translated ? 'text-green-400':'')} class:translating={translating} on:click={async () => {
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
import { postChatFile } from 'src/ts/process/files/multisend';
|
||||
import { getInlayImage } from 'src/ts/process/files/image';
|
||||
import PlaygroundMenu from '../Playground/PlaygroundMenu.svelte';
|
||||
import { ConnectionOpenStore } from 'src/ts/sync/multiuser';
|
||||
|
||||
let messageInput:string = ''
|
||||
let messageInputTranslate:string = ''
|
||||
@@ -81,7 +82,8 @@
|
||||
if($DataBase.useSayNothing){
|
||||
cha.push({
|
||||
role: 'user',
|
||||
data: '*says nothing*'
|
||||
data: '*says nothing*',
|
||||
name: $ConnectionOpenStore ? $CurrentUsername : null
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -98,14 +100,16 @@
|
||||
cha.push({
|
||||
role: 'user',
|
||||
data: await processScript(char,messageInput,'editinput'),
|
||||
time: Date.now()
|
||||
time: Date.now(),
|
||||
name: $ConnectionOpenStore ? $CurrentUsername : null
|
||||
})
|
||||
}
|
||||
else{
|
||||
cha.push({
|
||||
role: 'user',
|
||||
data: messageInput,
|
||||
time: Date.now()
|
||||
time: Date.now(),
|
||||
name: $ConnectionOpenStore ? $CurrentUsername : null
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -583,9 +587,9 @@
|
||||
<Chat
|
||||
character={$CurrentSimpleCharacter}
|
||||
idx={chat.index}
|
||||
name={$CurrentUsername}
|
||||
name={chat.name ?? $CurrentUsername}
|
||||
message={chat.data}
|
||||
img={getCharImage($CurrentUserIcon, 'css')}
|
||||
img={$ConnectionOpenStore ? '' : getCharImage($CurrentUserIcon, 'css')}
|
||||
isLastMemory={$CurrentChat.lastMemory === (chat.chatId ?? 'none') && $CurrentShowMemoryLimit}
|
||||
largePortrait={$UserIconProtrait}
|
||||
MessageGenerationInfo={chat.generationInfo}
|
||||
|
||||
Reference in New Issue
Block a user