Skip to content

Commit

Permalink
make stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
damniko committed Nov 9, 2023
1 parent d820244 commit abd05f4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 6 additions & 3 deletions ChatRPG/ChatRPG/Pages/Campaign.razor
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@
readonly List<string> _conversation = new List<string>();
private string _userInput = "";

protected override async Task OnInitializedAsync()
protected override async Task OnAfterRenderAsync(bool firstRender)
{
_shouldSave = Configuration.GetValue<bool>("SaveConversationsToFile");
_scrollJsScript = await JsRuntime.InvokeAsync<IJSObjectReference>("import", "./js/scroll.js");
if (firstRender)
{
_shouldSave = Configuration.GetValue<bool>("SaveConversationsToFile");
_scrollJsScript = await JsRuntime.InvokeAsync<IJSObjectReference>("import", "./js/scroll.js");
}
}

async Task EnterKeyHandler(KeyboardEventArgs e)
Expand Down
5 changes: 4 additions & 1 deletion ChatRPG/ChatRPG/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@
}
},
"AllowedHosts": "*",
"SaveConversationsToFile": true
"SaveConversationsToFile": true,
"ApiKeys": {
"OpenAI": "myOpenAiApiKey"
}
}

0 comments on commit abd05f4

Please sign in to comment.