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,5 +1,5 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { invoke } from '@tauri-apps/api/core';
|
||||
import { themeAnimationRisk } from '@/lib/api/platformShell';
|
||||
import { IS_LINUX } from '@/lib/util/platform';
|
||||
|
||||
/**
|
||||
@@ -27,7 +27,7 @@ export function useThemeAnimationRisk(): boolean {
|
||||
return;
|
||||
}
|
||||
let alive = true;
|
||||
const p = invoke<boolean>('theme_animation_risk');
|
||||
const p = themeAnimationRisk();
|
||||
// Guard the mocked-in-tests case where invoke isn't a real promise.
|
||||
if (p && typeof (p as Promise<boolean>).then === 'function') {
|
||||
(p as Promise<boolean>)
|
||||
|
||||
Reference in New Issue
Block a user