Add basic chat box when getting a warning

This commit is contained in:
Ajay Ramachandran
2021-07-29 18:16:44 -04:00
parent 1656fae2d4
commit 1a855a6993
6 changed files with 63 additions and 7 deletions

View File

@@ -415,6 +415,19 @@ export default class Utils {
return referenceNode;
}
objectToURI<T>(url: string, data: T, includeQuestionMark: boolean): string {
let counter = 0;
for (const key in data) {
const seperator = (url.includes("?") || counter > 0) ? "&" : (includeQuestionMark ? "?" : "");
const value = (typeof(data[key]) === "string") ? data[key] as unknown as string : JSON.stringify(data[key]);
url += seperator + encodeURIComponent(key) + "=" + encodeURIComponent(value);
counter++;
}
return url;
}
getFormattedTime(seconds: number, precise?: boolean): string {
const hours = Math.floor(seconds / 60 / 60);
const minutes = Math.floor(seconds / 60) % 60;