feat: android version correctly working alongside iOS version
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user