mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 15:25:46 +00:00
refactor(ipc): complete tauri-specta typed-IPC cutover, contract guards, and layering cleanup (#1230)
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { invoke } from '@tauri-apps/api/core';
|
||||
import { commands } from '@/generated/bindings';
|
||||
import { linuxWaylandTextRenderSettingsAvailable } from '@/lib/api/platformShell';
|
||||
import { save as saveDialog } from '@tauri-apps/plugin-dialog';
|
||||
import { open as openUrl } from '@tauri-apps/plugin-shell';
|
||||
import { AppWindow, ChevronDown, Download, ExternalLink, Globe, HardDrive, Info, Scale, Sliders, Users } from 'lucide-react';
|
||||
@@ -29,7 +30,7 @@ export function SystemTab() {
|
||||
|
||||
useEffect(() => {
|
||||
if (!IS_LINUX) return;
|
||||
invoke<boolean>('linux_wayland_text_render_settings_available')
|
||||
linuxWaylandTextRenderSettingsAvailable()
|
||||
.then(setWaylandTextRenderAvailable)
|
||||
.catch(() => {});
|
||||
}, []);
|
||||
@@ -43,8 +44,9 @@ export function SystemTab() {
|
||||
});
|
||||
if (!selected || Array.isArray(selected)) return;
|
||||
try {
|
||||
const lines = await invoke<number>('export_runtime_logs', { path: selected });
|
||||
showToast(t('settings.loggingExportSuccess', { count: lines }), 3500, 'info');
|
||||
const res = await commands.exportRuntimeLogs(selected);
|
||||
if (res.status === 'error') throw new Error(res.error);
|
||||
showToast(t('settings.loggingExportSuccess', { count: res.data }), 3500, 'info');
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
showToast(t('settings.loggingExportError'), 4500, 'error');
|
||||
|
||||
Reference in New Issue
Block a user