This commit is contained in:
Ren Amamiya 2023-08-10 17:03:50 +07:00
parent e6d8f084ae
commit 8024c09642
2 changed files with 18 additions and 7 deletions

View File

@ -1,5 +1,5 @@
import { useQuery } from '@tanstack/react-query';
import { useState } from 'react';
import { useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { UserRelay } from '@app/auth/components/userRelay';
@ -50,9 +50,6 @@ export function OnboardStep3Screen() {
}
);
// save current step, if user close app and reopen it
setStep('/auth/onboarding/step-3');
const toggleRelay = (relay: string) => {
if (relays.has(relay)) {
setRelays((prev) => {
@ -92,6 +89,11 @@ export function OnboardStep3Screen() {
const relaysAsArray = Array.from(data?.keys() || []);
useEffect(() => {
// save current step, if user close app and reopen it
setStep('/auth/onboarding/step-3');
}, []);
return (
<div className="mx-auto w-full max-w-md">
<div className="mb-8 text-center">

View File

@ -1,10 +1,19 @@
import { getVersion } from '@tauri-apps/plugin-app';
import { useEffect, useState } from 'react';
import { RefreshIcon } from '@shared/icons';
const appVersion = await getVersion();
export function VersionSetting() {
const [version, setVersion] = useState<string>('');
useEffect(() => {
async function checkVersion() {
const appVersion = await getVersion();
setVersion(appVersion);
}
checkVersion();
}, []);
return (
<div className="inline-flex items-center justify-between px-5 py-4">
<div className="flex flex-col gap-1">
@ -14,7 +23,7 @@ export function VersionSetting() {
</span>
</div>
<div className="inline-flex items-center gap-2">
<span className="font-medium text-zinc-300">{appVersion}</span>
<span className="font-medium text-zinc-300">{version}</span>
<button
type="button"
className="inline-flex h-8 w-8 items-center justify-center rounded-md bg-zinc-800 font-medium hover:bg-fuchsia-500"