add ui:showSidebarToggle config

This commit is contained in:
hippoz 2022-08-04 02:17:23 +03:00
parent ad8e6315ed
commit e7615879e4
Signed by: hippoz
GPG key ID: 7C52899193467641
2 changed files with 5 additions and 3 deletions

View file

@ -1,5 +1,6 @@
<script> <script>
import { HashIcon, MenuIcon } from "svelte-feather-icons"; import { HashIcon, MenuIcon } from "svelte-feather-icons";
import { getItem } from "../storage";
import { overlayStore, showSidebar } from "../stores"; import { overlayStore, showSidebar } from "../stores";
export let channel; export let channel;
@ -12,8 +13,8 @@
</style> </style>
<div class="top-bar"> <div class="top-bar">
{#if !$showSidebar} {#if !$showSidebar || getItem("ui:showSidebarToggle")}
<button class="icon-button menu-button" on:click="{ () => showSidebar.set(true) }"> <button class="icon-button menu-button" on:click="{ () => showSidebar.set(!showSidebar.value) }">
<MenuIcon /> <MenuIcon />
</button> </button>
{/if} {/if}

View file

@ -7,7 +7,8 @@ const defaults = {
"state:openChannelId": -1, "state:openChannelId": -1,
"log:Gateway": false, "log:Gateway": false,
"log:Store": false, "log:Store": false,
"ui:stateful:presistSelectedChannel": true "ui:stateful:presistSelectedChannel": true,
"ui:showSidebarToggle": false
}; };
const store = new Map(Object.entries(defaults)); const store = new Map(Object.entries(defaults));
const persistentProvider = localStorage; const persistentProvider = localStorage;