MaelImhof / obsidian-jupyter

Edit .ipynb Jupyter files directly in Obsidian.
https://jupyter.mael.im/
29 stars 1 forks source link

Plugin settings deleted on PC when sync to mobile #86

Open MaelImhof opened 2 weeks ago

MaelImhof commented 2 weeks ago

(Originally reported on Discord)

When the plugin is synced between a computer and a mobile device, the plugin is displayed as incompatible with the mobile device and the settings get deleted, on the desktop too.

I suspect this is because of the isDesktopOnly property in the manifest. Maybe setting this to false and manually telling the user that this plugin is not mobile-friendly will do the trick.

MaelImhof commented 2 weeks ago

This fix is not as easy as expected.

My initial thought was to modify onload to check whether the environment is mobile (with Platform.isMobile) and tell the user that the plugin does not support mobile.

However, the imports are still executed, and

import { existsSync, rmdirSync } from "fs";

is causing problems, same for other imports from built-in libraries of NodeJS.

I tried using dynamic import() assignments, but no luck so far. With this method, even the desktop version stops working.