We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 04ff2d0 commit bfdfd42Copy full SHA for bfdfd42
1 file changed
src/main.ts
@@ -116,10 +116,16 @@ export default class WordpressPlugin extends Plugin {
116
}
117
118
private openProfileChooser(): void {
119
- new WpProfileChooserModal(this.app, this, (profile) => {
120
- console.log(profile);
121
- this.doClientPublish(profile);
122
- }).open();
+ if (this.settings.profiles.length === 1) {
+ this.doClientPublish(this.settings.profiles[0]);
+ } else if (this.settings.profiles.length > 1) {
+ new WpProfileChooserModal(this.app, this, (profile) => {
123
+ console.log(profile);
124
+ this.doClientPublish(profile);
125
+ }).open();
126
+ } else {
127
+ new Notice(this.i18n.t('error_noProfile'));
128
+ }
129
130
131
private doClientPublish(profile: WpProfile, defaultPostParams?: WordPressPostParams): void {
0 commit comments