Allow passing in the API key as a query parameter
This commit is contained in:
parent
ac786b3dc8
commit
d512aa83bc
|
@ -10,6 +10,12 @@
|
|||
$: sortedChats = $chatsStorage.sort((a, b) => b.id - a.id);
|
||||
$: apiKey = $apiKeyStorage;
|
||||
|
||||
// Check if the API key is passed in as a "key" query parameter - if so, save it
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
if (urlParams.has("key")) {
|
||||
apiKeyStorage.set(urlParams.get("key")!);
|
||||
}
|
||||
|
||||
let activeChatId: number;
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue