Fix conditional statements in Chat.svelte, DefaultChatScreen.svelte, SideChatList.svelte, and Sidebar.svelte

This commit is contained in:
kwaroran
2024-04-25 14:31:32 +09:00
parent 6ae39619b7
commit 8d91267c69
4 changed files with 6 additions and 6 deletions

View File

@@ -131,7 +131,7 @@
<div class="flex max-w-full justify-center risu-chat" style={isLastMemory ? `border-top:${$DataBase.memoryLimitThickness}px solid rgba(98, 114, 164, 0.7);` : ''}>
<div class="text-textcolor mt-1 ml-4 mr-4 mb-1 p-2 bg-transparent flex-grow border-t-gray-900 border-opacity-30 border-transparent flexium items-start max-w-full" >
{#if !blankMessage}
{#if $CurrentCharacter.chaId === "§playground"}
{#if $CurrentCharacter?.chaId === "§playground"}
<div class="shadow-lg border-textcolor2 border mt-2 flex justify-center items-center text-textcolor2" style={`height:${$DataBase.iconsize * 3.5 / 100}rem;width:${$DataBase.iconsize * 3.5 / 100}rem;min-width:${$DataBase.iconsize * 3.5 / 100}rem`}
class:rounded-md={!$DataBase.roundIcons} class:rounded-full={$DataBase.roundIcons}>
{#if name === 'assistant'}
@@ -157,7 +157,7 @@
{/if}
<span class="flex flex-col ml-4 w-full max-w-full min-w-0">
<div class="flexium items-center chat">
{#if $CurrentCharacter.chaId === "§playground" && !blankMessage}
{#if $CurrentCharacter?.chaId === "§playground" && !blankMessage}
<span class="chat text-xl border-darkborderc flex items-center">
<span>{name === 'assistant' ? 'Assistant' : 'User'}</span>
<button class="ml-2 text-textcolor2 hover:text-textcolor" on:click={() => {

View File

@@ -451,7 +451,7 @@
class="mr-2 bg-textcolor2 flex justify-center items-center text-gray-100 w-12 h-12 rounded-md hover:bg-green-500 transition-colors"><Send />
</div>
{/if}
{#if $CurrentCharacter.chaId !== '§playground'}
{#if $CurrentCharacter?.chaId !== '§playground'}
<div on:click={(e) => {
openMenu = !openMenu
e.stopPropagation()
@@ -470,7 +470,7 @@
</div>
{/if}
</div>
{#if $DataBase.useAutoTranslateInput && !$DataBase.useAdvancedEditor && $CurrentCharacter.chaId !== '§playground'}
{#if $DataBase.useAutoTranslateInput && !$DataBase.useAdvancedEditor && $CurrentCharacter?.chaId !== '§playground'}
<div class="flex items-center mt-2 mb-2">
<label for='messageInputTranslate' class="text-textcolor ml-4">
<LanguagesIcon />

View File

@@ -105,7 +105,7 @@
</button>
</div>
{#if $CurrentCharacter.chaId !== '§playground'}
{#if $CurrentCharacter?.chaId !== '§playground'}
<div class="flex mt-2 items-center">
<CheckInput bind:check={$DataBase.jailbreakToggle} name={language.jailbreakToggle}/>
</div>

View File

@@ -655,7 +655,7 @@
<h1 class="text-xl">Welcome to RisuAI!</h1>
<span class="text-xs text-textcolor2">Select a bot to start chating</span>
</div>
{:else if $CurrentCharacter.chaId === '§playground'}
{:else if $CurrentCharacter?.chaId === '§playground'}
<SideChatList bind:chara={ $CurrentCharacter} />
{:else}
<div class="w-full h-8 min-h-8 border-l border-b border-r border-selected relative bottom-6 rounded-b-md flex">