Skip to content

Commit

Permalink
#49 - check local instance before displaying noapikey error
Browse files Browse the repository at this point in the history
  • Loading branch information
Limekiller committed Jun 4, 2024
1 parent 933e861 commit b887871
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion block_openai_chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ public function get_content() {
<div id="openai_chat_log" role="log"></div>
';

if (empty(get_config('block_openai_chat', 'apikey'))) {
if (
empty(get_config('block_openai_chat', 'apikey')) &&
(!get_config('block_openai_chat', 'allowinstancesettings') || empty($this->config->apikey))
) {
$this->content->footer = get_string('apikeymissing', 'block_openai_chat');
} else {
$contextdata = [
Expand Down

0 comments on commit b887871

Please sign in to comment.