small updates and bump version

This commit is contained in:
Ren Amamiya 2023-09-05 17:25:00 +07:00
parent 224439f62b
commit 69a3e85cb3
8 changed files with 32 additions and 17 deletions

View File

@ -2,7 +2,7 @@
"name": "lume", "name": "lume",
"description": "the communication app", "description": "the communication app",
"private": true, "private": true,
"version": "1.2.1", "version": "1.2.2",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vite build", "build": "vite build",

2
src-tauri/Cargo.lock generated
View File

@ -2627,7 +2627,7 @@ dependencies = [
[[package]] [[package]]
name = "lume" name = "lume"
version = "1.2.1" version = "1.2.2"
dependencies = [ dependencies = [
"rust-argon2 1.0.0", "rust-argon2 1.0.0",
"serde", "serde",

View File

@ -1,7 +1,7 @@
[package] [package]
name = "lume" name = "lume"
version = "1.2.1" version = "1.2.2"
description = "nostr client" description = "the communication app"
authors = ["Ren Amamiya"] authors = ["Ren Amamiya"]
license = "GPL-3.0" license = "GPL-3.0"
repository = "https://github.com/luminous-devs/lume" repository = "https://github.com/luminous-devs/lume"

View File

@ -8,7 +8,7 @@
}, },
"package": { "package": {
"productName": "Lume", "productName": "Lume",
"version": "1.2.1" "version": "1.2.2"
}, },
"tauri": { "tauri": {
"allowlist": { "allowlist": {

View File

@ -3,32 +3,43 @@ import { useLocation, useRouteError } from 'react-router-dom';
import { Frame } from '@shared/frame'; import { Frame } from '@shared/frame';
interface IRouteError { interface RouteError {
statusText: string; statusText: string;
message: string; message: string;
} }
interface IDebugInfo { interface DebugInfo {
os: null | string; os: null | string;
version: null | string; version: null | string;
appDir: null | string;
} }
export function ErrorScreen() { export function ErrorScreen() {
const error = useRouteError() as IRouteError; const error = useRouteError() as RouteError;
const location = useLocation(); const location = useLocation();
const [debugInfo, setDebugInfo] = useState<IDebugInfo>({ os: null, version: null }); const [debugInfo, setDebugInfo] = useState<DebugInfo>({
os: null,
version: null,
appDir: null,
});
useEffect(() => { useEffect(() => {
async function getInformation() { async function getInformation() {
const { platform, version } = await import('@tauri-apps/api/os'); const { platform, version } = await import('@tauri-apps/api/os');
const { getVersion } = await import('@tauri-apps/api/app'); const { getVersion } = await import('@tauri-apps/api/app');
const { appConfigDir } = await import('@tauri-apps/api/path');
const platformName = await platform(); const platformName = await platform();
const osVersion = await version(); const osVersion = await version();
const appVersion = await getVersion(); const appVersion = await getVersion();
const appDir = await appConfigDir();
setDebugInfo({ os: platformName + ' ' + osVersion, version: appVersion }); setDebugInfo({
os: platformName + ' ' + osVersion,
version: appVersion,
appDir: appDir,
});
} }
getInformation(); getInformation();
@ -36,7 +47,7 @@ export function ErrorScreen() {
return ( return (
<Frame className="flex h-full items-center justify-center"> <Frame className="flex h-full items-center justify-center">
<div className="flex max-w-lg flex-col gap-4"> <div className="flex w-full flex-col gap-4 px-4 md:max-w-lg md:px-0">
<div className="flex flex-col"> <div className="flex flex-col">
<h1 className="mb-1 text-2xl font-semibold text-white"> <h1 className="mb-1 text-2xl font-semibold text-white">
Sorry, an unexpected error has occurred. Sorry, an unexpected error has occurred.
@ -59,19 +70,19 @@ export function ErrorScreen() {
href="https://github.com/luminous-devs/lume/issues/new" href="https://github.com/luminous-devs/lume/issues/new"
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
className="inline-flex h-11 w-full items-center justify-center rounded-lg bg-white/10 text-sm font-medium text-white backdrop-blur-xl hover:bg-white/20" className="inline-flex h-11 w-full items-center justify-center rounded-lg text-sm font-medium text-white backdrop-blur-xl hover:bg-white/10"
> >
Click here to report the issue on GitHub Click here to report the issue on GitHub
</a> </a>
<button <button
type="button" type="button"
className="inline-flex h-11 w-full items-center justify-center rounded-lg bg-white/10 text-sm font-medium text-white backdrop-blur-xl hover:bg-white/20" className="inline-flex h-11 w-full items-center justify-center rounded-lg text-sm font-medium text-white backdrop-blur-xl hover:bg-white/10"
> >
Reload app Reload app
</button> </button>
<button <button
type="button" type="button"
className="inline-flex h-11 w-full items-center justify-center rounded-lg bg-white/10 text-sm font-medium text-white backdrop-blur-xl hover:bg-white/20" className="inline-flex h-11 w-full items-center justify-center rounded-lg text-sm font-medium text-white backdrop-blur-xl hover:bg-white/10"
> >
Reset app Reset app
</button> </button>

View File

@ -38,12 +38,16 @@ export function Composer() {
}, },
}), }),
], ],
content: '', content: JSON.parse(localStorage.getItem('editor-content') || '{}'),
editorProps: { editorProps: {
attributes: { attributes: {
class: 'h-full markdown break-all overflow-y-auto outline-none pr-2', class: 'h-full markdown break-all overflow-y-auto outline-none pr-2',
}, },
}, },
onUpdate: ({ editor }) => {
const jsonContent = JSON.stringify(editor.getJSON());
localStorage.setItem('editor-content', jsonContent);
},
}); });
const submit = async () => { const submit = async () => {

View File

@ -18,7 +18,7 @@ export const useSidebar = create<SidebarState>()(
}), }),
{ {
name: 'sidebar', name: 'sidebar',
storage: createJSONStorage(() => localStorage), storage: createJSONStorage(() => sessionStorage),
} }
) )
); );

View File

@ -122,7 +122,7 @@ export const useWidgets = create<WidgetState>()(
}), }),
{ {
name: 'widgets', name: 'widgets',
storage: createJSONStorage(() => localStorage), storage: createJSONStorage(() => sessionStorage),
} }
) )
); );