Skip to content

Commit

Permalink
fixed plugin submission issues
Browse files Browse the repository at this point in the history
  • Loading branch information
name committed Feb 15, 2025
1 parent 3decb0b commit 376b00a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 44 deletions.
39 changes: 1 addition & 38 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,7 @@ export default class Chatto extends Plugin {
const statusBarItemEl = this.addStatusBarItem();
statusBarItemEl.setText('Chatto Active');

// This adds a simple command that can be triggered anywhere
this.addCommand({
id: 'open-chatto-modal-simple',
name: 'Open chatto modal (simple)',
callback: () => {
new ChattoModal(this.app).open();
}
});

// This adds an editor command that can perform some operation on the current editor instance
this.addCommand({
id: 'chatto-editor-command',
Expand All @@ -97,25 +90,6 @@ export default class Chatto extends Plugin {
editor.replaceSelection('Chatto Editor Command');
}
});
// This adds a complex command that can check whether the current state of the app allows execution of the command
this.addCommand({
id: 'open-chatto-modal-complex',
name: 'Open chatto modal (complex)',
checkCallback: (checking: boolean) => {
// Conditions to check
const markdownView = this.app.workspace.getActiveViewOfType(MarkdownView);
if (markdownView) {
// If checking is true, we're simply "checking" if the command can be run.
// If checking is false, then we want to actually perform the operation.
if (!checking) {
new ChattoModal(this.app).open();
}

// This command will only show up in Command Palette when the check function returns true
return true;
}
}
});

// This adds a settings tab so the user can configure various aspects of the plugin
this.addSettingTab(new ChattoSettingTab(this.app, this));
Expand Down Expand Up @@ -243,17 +217,6 @@ class ChattoSettingTab extends PluginSettingTab {

containerEl.empty();

new Setting(containerEl)
.setName('Setting #1')
.setDesc('It\'s a secret')
.addText(text => text
.setPlaceholder('Enter your secret')
.setValue(this.plugin.settings.mySetting)
.onChange(async (value) => {
this.plugin.settings.mySetting = value;
await this.plugin.saveSettings();
}));

new Setting(containerEl)
.setName('Perplexity API Key')
.setDesc('Enter your Perplexity API key')
Expand Down
6 changes: 3 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"id": "obsidian-chatto",
"id": "chatto",
"name": "Chatto",
"version": "1.0.0",
"version": "1.0.1",
"minAppVersion": "0.15.0",
"description": "Copilot for Obsidian",
"description": "Copilot for your notes",
"author": "cunjur",
"authorUrl": "https://char.blog",
"isDesktopOnly": true
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "obsidian-chatto",
"version": "1.0.0",
"description": "Copilot for Obsidian",
"name": "chatto",
"version": "1.0.1",
"description": "Copilot for your notes",
"main": "main.js",
"scripts": {
"dev": "node esbuild.config.mjs",
Expand Down

0 comments on commit 376b00a

Please sign in to comment.