Skip to content

Commit

Permalink
Fixing an issue where the plugin would fail to load on mobile(closes #24
Browse files Browse the repository at this point in the history
)
  • Loading branch information
joethei committed Apr 4, 2022
1 parent 502fa53 commit 343fa47
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-plantuml",
"name": "PlantUML",
"version": "1.5.2",
"version": "1.5.3",
"minAppVersion": "0.13.0",
"description": "Render PlantUML Diagrams",
"author": "Johannes Theiner",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-plantuml",
"version": "1.5.2",
"version": "1.5.3",
"description": "PlantUML rendering for Obsidian.md",
"main": "main.js",
"scripts": {
Expand Down
8 changes: 7 additions & 1 deletion src/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ export function isUsingLivePreviewEnabledEditor() : boolean {
if(config.legacyEditor) return false;

//requireApiVersion() has been added with 0.13.23, so we need a different method to be sure
const version = navigator.userAgent.match(/obsidian([^ ]+)/).first().split("/")[1];
const userAgent = navigator.userAgent.match(/obsidian([^ ]+)/);

//we are on mobile, there is no legacy editor on mobile.
if (userAgent === null) {
return true;
}
const version = userAgent.first().split("/")[1];
//live preview was added with 0.13, so there is no way that prior versions would support it.
return compareVersions.compare(version, "0.13.0", ">=");
}
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
"1.4.0": "0.12.0",
"1.5.0": "0.13.0",
"1.5.1": "0.13.0",
"1.5.2": "0.13.0"
"1.5.2": "0.13.0",
"1.5.3": "0.13.0"
}

0 comments on commit 343fa47

Please sign in to comment.