feat: android version correctly working alongside iOS version

This commit is contained in:
2025-05-03 13:16:28 +01:00
parent 92e346578a
commit bb280f52fe
5 changed files with 37 additions and 12 deletions

View File

@@ -16,6 +16,7 @@ import {
import { readFile } from "@tauri-apps/plugin-fs";
const currentPlatform = platform();
console.log("Current Platform: ", currentPlatform);
export const App = () => {
createEffect(() => {
@@ -35,9 +36,13 @@ export const App = () => {
}
let listener: PluginListener;
const setupListener = async () => {
console.log("Setting up listener");
listener = await listenForShareEvents(
async (intent: ShareEvent) => {
console.log(intent);
const contents = await readFile(intent.stream ?? "").catch(
(error: Error) => {
console.warn("fetching shared content failed:");
@@ -53,6 +58,7 @@ export const App = () => {
},
);
};
setupListener();
return () => {
listener?.unregister();