diff --git a/main.ts b/main.ts index 65210be..d821ad4 100644 --- a/main.ts +++ b/main.ts @@ -89,6 +89,10 @@ export default class NibbleAI extends Plugin { new Notice("Already recording"); return; } + if (!this.audioHandler.getTranscriptionApiKey()) { + new Notice("✘ Add your API key for the selected transcription provider in NibbleAI settings"); + return; + } try { await this.recorder.startRecording(); this.statusBar.updateStatus(RecordingStatus.Recording); diff --git a/src/transcription/AudioHandler.ts b/src/transcription/AudioHandler.ts index a6fbc48..4bcd70b 100644 --- a/src/transcription/AudioHandler.ts +++ b/src/transcription/AudioHandler.ts @@ -30,7 +30,7 @@ export class AudioHandler { } } - private getTranscriptionApiKey(): string { + getTranscriptionApiKey(): string { switch (this.plugin.settings.transcriptionProvider) { case "groq": return this.plugin.settings.groqApiKey;