Change DataBase inside svelte to DBState for performance
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
import SideChatList from "../SideBars/SideChatList.svelte";
|
||||
import DevTool from "../SideBars/DevTool.svelte";
|
||||
import { isLite } from "src/ts/lite";
|
||||
import { DataBase } from "src/ts/storage/database";
|
||||
import { DBState } from "src/ts/storage/database.svelte";
|
||||
</script>
|
||||
|
||||
{#if $MobileSideBar > 0 && !$isLite}
|
||||
@@ -36,7 +36,7 @@
|
||||
{#if $MobileSideBar > 0}
|
||||
<div class="w-full flex flex-col p-2 mt-2 h-full">
|
||||
{#if $MobileSideBar === 1}
|
||||
<SideChatList bind:chara={$DataBase.characters[$selectedCharID]} />
|
||||
<SideChatList bind:chara={DBState.db.characters[$selectedCharID]} />
|
||||
{:else if $MobileSideBar === 2}
|
||||
<CharConfig />
|
||||
{:else if $MobileSideBar === 3}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { type character, DataBase, type groupChat } from "src/ts/storage/database";
|
||||
import { type character, DBState, type groupChat } from "src/ts/storage/database.svelte";
|
||||
import BarIcon from "../SideBars/BarIcon.svelte";
|
||||
import { addCharacter, changeChar, getCharImage } from "src/ts/characters";
|
||||
import { MobileSearch } from "src/ts/stores";
|
||||
@@ -55,7 +55,7 @@
|
||||
}
|
||||
</script>
|
||||
<div class="flex flex-col items-center w-full overflow-y-auto h-full">
|
||||
{#each sortChar($DataBase.characters) as char, i}
|
||||
{#each sortChar(DBState.db.characters) as char, i}
|
||||
{#if char.name.toLocaleLowerCase().includes($MobileSearch.toLocaleLowerCase())}
|
||||
<button class="flex p-2 border-t-darkborderc gap-2 w-full" class:border-t={i !== 0} onclick={() => {
|
||||
changeChar(char.i)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { ArrowLeft, MenuIcon } from "lucide-svelte";
|
||||
import { language } from "src/lang";
|
||||
import { DataBase } from "src/ts/storage/database";
|
||||
import { DBState } from "src/ts/storage/database.svelte";
|
||||
import { MobileGUIStack, MobileSearch, selectedCharID, SettingsMenuIndex, MobileSideBar } from "src/ts/stores";
|
||||
|
||||
</script>
|
||||
@@ -19,7 +19,7 @@
|
||||
}}>
|
||||
<ArrowLeft />
|
||||
</button>
|
||||
<span class="font-bold text-lg w-2/3 truncate">{$DataBase.characters[$selectedCharID].name}</span>
|
||||
<span class="font-bold text-lg w-2/3 truncate">{DBState.db.characters[$selectedCharID].name}</span>
|
||||
<div class="flex-1 flex justify-end">
|
||||
<button onclick={() => {
|
||||
MobileSideBar.set(1)
|
||||
|
||||
Reference in New Issue
Block a user