Skip to content

Commit

Permalink
Fixes to update page.
Browse files Browse the repository at this point in the history
  • Loading branch information
ibz committed Feb 14, 2024
1 parent 38abf47 commit 284453b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,31 @@
let updateButtonActive = version !== lastVersion && !inRequest;
onMount(async () => {
getStatus((v, lv) => { version = v; });
getStatus((v, lv) => { version = v; lastVersion = lv; });
});
</script>

{#if $page.url.pathname === "/admin/account/settings"}
<div class="text-2xl breadcrumbs">
<ul>
<li>Settings</li>
<li>Version</li>
<li>App</li>
</ul>
</div>
{:else}
<h2 class="text-2xl">Version</h2>
<h2 class="text-2xl">App</h2>
{/if}

<div class="w-full flex items-center justify-center mt-8">
<p class="text-2xl">You are currently running Plebeian Market {version}.</p>
<p class="text-2xl">The last available version is {lastVersion}.</p>
</div>

<div class="flex justify-center items-center mt-4 h-15">
<button id="update-pm" class="btn btn-primary" class:btn-disabled={!updateButtonActive} on:click|preventDefault={update}>Update</button>
</div>
{#if version !== null && lastVersion !== null}
<div class="items-center justify-center mt-8">
<p class="text-2xl">You are currently running<br /><strong>Plebeian Market {version}</strong>.</p>
<p class="text-2xl mt-4">The last available version is <strong>{lastVersion}</strong>.</p>
</div>
<div class="flex justify-center items-center mt-8 h-15">
<button id="update-pm" class="btn btn-primary" class:btn-disabled={!updateButtonActive} on:click|preventDefault={update}>Update</button>
</div>
{:else}
<div class="items-center justify-center mt-8">
<p class="text-2xl">Running <strong>Plebeian Market</strong>.</p>
</div>
{/if}
10 changes: 5 additions & 5 deletions web/backoffice/src/routes/account/settings/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import Nostr from "$lib/components/settings/Nostr.svelte";
import Login from "$lib/components/settings/Login.svelte";
import V4V from "$lib/components/settings/V4V.svelte";
import Version from "$lib/components/settings/Version.svelte";
import App from "$lib/components/settings/App.svelte";
import Wallet from "$lib/components/settings/Wallet.svelte";
import { goto } from '$app/navigation';
Expand All @@ -21,8 +21,8 @@
let NOSTR_PAGE = "Nostr";
let LOGIN_PAGE = "Login";
let V4V_PAGE = "Value 4 Value";
let VERSION_PAGE = "Version";
let pages = [STALL_PAGE, LOGIN_PAGE, WALLET_PAGE, EMAIL_PAGE, NOSTR_PAGE, V4V_PAGE, VERSION_PAGE];
let APP_PAGE = "App";
let pages = [STALL_PAGE, LOGIN_PAGE, WALLET_PAGE, EMAIL_PAGE, NOSTR_PAGE, V4V_PAGE, APP_PAGE];
let WALLET_PAGE_INDEX = pages.indexOf(WALLET_PAGE);
let currentPage: string | null = null;
Expand Down Expand Up @@ -72,8 +72,8 @@
<Login />
{:else if currentPage === V4V_PAGE}
<V4V />
{:else if currentPage === VERSION_PAGE}
<Version />
{:else if currentPage === APP_PAGE}
<App />
{/if}
</div>
</div>
Expand Down

0 comments on commit 284453b

Please sign in to comment.