From 0223754cffcfdcc095b25f05528cd466ba3b13cd Mon Sep 17 00:00:00 2001 From: Otavio Cordeiro Date: Sun, 26 Nov 2023 19:25:31 +0100 Subject: [PATCH] Limit Quick Compose to Desktop only --- manifest.json | 2 +- src/MicroPlugin.ts | 36 +++++++++++++++++++----------------- versions.json | 3 ++- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/manifest.json b/manifest.json index 6e6c5c9..cef1610 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "microblog-publish-plugin", "name": "Micro.publish", - "version": "2.3.0", + "version": "2.3.1", "minAppVersion": "0.15.0", "description": "Publish notes to Micro.blog", "author": "Otavio Cordeiro", diff --git a/src/MicroPlugin.ts b/src/MicroPlugin.ts index 7cadbbb..2b738bf 100644 --- a/src/MicroPlugin.ts +++ b/src/MicroPlugin.ts @@ -11,7 +11,7 @@ import { PublishPageView } from '@views/PublishPageView' import { PublishPostView } from '@views/PublishPostView' import { UpdatePageView } from '@views/UpdatePageView' import { UpdatePostView } from '@views/UpdatePostView' -import { Notice, Plugin } from 'obsidian' +import { Notice, Plugin, Platform } from 'obsidian' export default class MicroPlugin extends Plugin { @@ -88,14 +88,6 @@ export default class MicroPlugin extends Plugin { } }) - this.addCommand({ - id: 'microblog-publish-compose-micropost', - name: 'Compose Micropost', - callback: () => { - this.openComposeMicropostView() - } - }) - this.addCommand({ id: 'microblog-categories-sync-command', name: 'Synchronize Categories', @@ -104,20 +96,30 @@ export default class MicroPlugin extends Plugin { } }) + if (Platform.isDesktopApp) { + this.addCommand({ + id: 'microblog-publish-compose-micropost', + name: 'Compose Micropost', + callback: () => { + this.openComposeMicropostView() + } + }) + + this.addRibbonIcon( + "message-circle", + "Compose Micropost", + () => { + this.openComposeMicropostView() + } + ) + } + this.addSettingTab( new MicroPluginSettingsView( this.viewModelFactory.makeMicroPluginSettingsViewModel(), this.app ) ) - - this.addRibbonIcon( - "message-circle", - "Compose Micropost", - () => { - this.openComposeMicropostView() - } - ) } public onunload() { } diff --git a/versions.json b/versions.json index 5c10c67..aef669f 100644 --- a/versions.json +++ b/versions.json @@ -12,5 +12,6 @@ "2.2.0": "0.15.0", "2.2.1": "0.15.0", "2.2.2": "0.15.0", - "2.3.0": "0.15.0" + "2.3.0": "0.15.0", + "2.3.1": "0.15.0" }