mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-19 23:00:45 -07:00
Refactor Tauri Integration to Use Platform Context
- Replaced direct Tauri API calls with a unified platform context across multiple components, enhancing code maintainability and readability. - Removed the deprecated tauri.ts file, consolidating platform-related logic into the new PlatformContext. - Updated components such as App, AudioPlayer, and ServerSettings to utilize the new platform context for lifecycle management and server interactions. - Improved platform detection and handling for audio playback and system audio capture functionalities. - Ensured consistent error handling and user feedback across the application when interacting with platform-specific features.
This commit is contained in:
+6
-2
@@ -5,6 +5,8 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import App from '@/App';
|
||||
// Import CSS from app directory using alias so Tailwind can scan the source files
|
||||
import '@/index.css';
|
||||
import { PlatformProvider } from '@/platform/PlatformContext';
|
||||
import { tauriPlatform } from './platform';
|
||||
|
||||
const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
@@ -20,8 +22,10 @@ const queryClient = new QueryClient({
|
||||
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||
<React.StrictMode>
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<App />
|
||||
{/* <ReactQueryDevtools initialIsOpen={false} /> */}
|
||||
<PlatformProvider platform={tauriPlatform}>
|
||||
<App />
|
||||
{/* <ReactQueryDevtools initialIsOpen={false} /> */}
|
||||
</PlatformProvider>
|
||||
</QueryClientProvider>
|
||||
</React.StrictMode>,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user