Skip to content

Commit

Permalink
Edit settings: minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HyeonseoNam committed Mar 19, 2023
1 parent faa5f27 commit a8cf928
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,15 @@ export class AutoTaggerSettingTab extends PluginSettingTab {
this.plugin.settings.apiKeyCreatedAt
apiTestMessageEl.setText('Testing api call...');
apiTestMessageEl.style.color = 'var(--text-normal)';
this.plugin.settings.apiKeyCreatedAt = new Date();
try {
await ChatGPT.callAPI('', 'test', this.plugin.settings.apiKey);
apiTestMessageEl.setText('Success! API working.');
apiTestMessageEl.style.color = 'var(--success-color)';
this.plugin.settings.apiKeyCreatedAt = new Date();
} catch (error) {
apiTestMessageEl.setText('Error: API is not working.');
apiTestMessageEl.style.color = 'var(--warning-color)';
this.plugin.settings.apiKeyCreatedAt = null;
}
});
});
Expand Down

0 comments on commit a8cf928

Please sign in to comment.