Skip to content

Commit

Permalink
Limit Quick Compose to Desktop only
Browse files Browse the repository at this point in the history
  • Loading branch information
otaviocc committed Nov 26, 2023
1 parent cd4307c commit 0223754
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
36 changes: 19 additions & 17 deletions src/MicroPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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',
Expand All @@ -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() { }
Expand Down
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit 0223754

Please sign in to comment.