Migrate from window.electron to tauri IPC functions across components
- Replaced `window.electron.invoke` calls with equivalent `tauri` function calls for all IPC interactions. - Removed `electron.d.ts` TypeScript definitions as they are no longer needed. - Updated related logic for offline/online state synchronization. - Added `types.rs` and `shared/mod.rs` modules to support Tauri IPC integration with Rust enums and shared logic. - Refactored IPC request queues to use updated handler names for consistency with Tauri.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Database Error Handler for Frontend
|
||||
* Handles errors from Electron IPC calls
|
||||
* Handles errors from Tauri invoke calls
|
||||
*/
|
||||
|
||||
export interface SerializedError {
|
||||
@@ -69,7 +69,7 @@ export async function handleDbOperation<T>(
|
||||
* const { data, error, loading, execute } = useDbOperation();
|
||||
*
|
||||
* const loadBooks = async () => {
|
||||
* await execute(() => window.electron.invoke('db:book:getAll'));
|
||||
* await execute(() => tauri.getBooks());
|
||||
* };
|
||||
*/
|
||||
export function useDbOperation<T>() {
|
||||
|
||||
Reference in New Issue
Block a user