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:
@@ -18,6 +18,7 @@ import QuillSense from "@/components/quillsense/QuillSenseComponent";
|
||||
import {useTranslations} from "next-intl";
|
||||
import {faSpinner} from "@fortawesome/free-solid-svg-icons";
|
||||
import OfflineContext, {OfflineContextType} from "@/context/OfflineContext";
|
||||
import * as tauri from '@/lib/tauri';
|
||||
|
||||
// Lazy loaded Editor components
|
||||
const WorldEditor = lazy(function () {
|
||||
@@ -150,7 +151,7 @@ export default function ComposerRightBar(): React.JSX.Element {
|
||||
badge: t("composerRightBar.homeComponents.facebook.badge"),
|
||||
icon: faFacebook,
|
||||
action: function (): Promise<void> {
|
||||
return window.electron.openExternal('https://www.facebook.com/profile.php?id=61562628720878');
|
||||
return tauri.openExternal('https://www.facebook.com/profile.php?id=61562628720878');
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -160,7 +161,7 @@ export default function ComposerRightBar(): React.JSX.Element {
|
||||
badge: t("composerRightBar.homeComponents.discord.badge"),
|
||||
icon: faDiscord,
|
||||
action: function (): Promise<void> {
|
||||
return window.electron.openExternal('https://discord.gg/CHXRPvmaXm');
|
||||
return tauri.openExternal('https://discord.gg/CHXRPvmaXm');
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user