aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index abff2eaba..91fa459c6 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -48,6 +48,11 @@ export namespace Utils {
return prepend("/corsProxy/") + encodeURIComponent(url);
}
+ export async function getApiKey(target: string): Promise<string> {
+ const response = await fetch(prepend(`environment/${target.toUpperCase()}`));
+ return response.text();
+ }
+
export function CopyText(text: string) {
var textArea = document.createElement("textarea");
textArea.value = text;
@@ -174,7 +179,7 @@ export namespace Utils {
}
let idString = (message.id || "").padStart(36, ' ');
prefix = prefix.padEnd(16, ' ');
- console.log(`${prefix}: ${idString}, ${receiving ? 'receiving' : 'sending'} ${messageName} with data ${JSON.stringify(message)}`);
+ console.log(`${prefix}: ${idString}, ${receiving ? 'receiving' : 'sending'} ${messageName} with data ${JSON.stringify(message)} `);
}
function loggingCallback(prefix: string, func: (args: any) => any, messageName: string) {