aboutsummaryrefslogtreecommitdiff
path: root/client-web
diff options
context:
space:
mode:
Diffstat (limited to 'client-web')
-rw-r--r--client-web/public/assets/style/logger.css18
-rw-r--r--client-web/source/logger.ts8
-rw-r--r--client-web/source/protocol/crypto.ts2
3 files changed, 13 insertions, 15 deletions
diff --git a/client-web/public/assets/style/logger.css b/client-web/public/assets/style/logger.css
index 3d5c6e3..6cc70f3 100644
--- a/client-web/public/assets/style/logger.css
+++ b/client-web/public/assets/style/logger.css
@@ -10,6 +10,15 @@
padding: 0.2em;
}
+.logger-error {
+ font-size: 1.5em !important;
+ color: red;
+}
+.logger-warn {
+ font-size: 1.5em !important;
+ color: yellow;
+}
+
.logger-line {
font-size: 1em;
height: 1.2em;
@@ -26,15 +35,6 @@
animation-fill-mode: forwards;
}
-.logger-error {
- font-size: 2em;
- color: red;
-}
-.logger-warn {
- font-size: 2em;
- color: yellow;
-}
-
@keyframes appear {
from {
margin-top: -1.2em;
diff --git a/client-web/source/logger.ts b/client-web/source/logger.ts
index f8fa0b3..23f2cf6 100644
--- a/client-web/source/logger.ts
+++ b/client-web/source/logger.ts
@@ -30,17 +30,17 @@ export function log(k: LogScope | LogDesc, message: string, ...data: unknown[])
if (logger_container) {
const e = document.createElement("p")
e.classList.add("logger-line")
- if (d.error) e.classList.add(".logger-error")
- if (d.warn) e.classList.add(".logger-warn")
+ if (d.error) e.classList.add("logger-error")
+ else if (d.warn) e.classList.add("logger-warn")
+ else e.style.color = log_scope_color[d.scope]
e.textContent = `[${d.scope}] ${message}`
- if (!d.error && !d.warn) e.style.color = log_scope_color[d.scope]
logger_container.append(e)
setTimeout(() => {
e.classList.add("logger-line-disappear")
setTimeout(() => {
e.remove()
}, 1000 + 500)
- }, (d.error || d.warn) ? 60000 : 3000)
+ }, (d.error || d.warn) ? 20000 : 3000)
}
}
diff --git a/client-web/source/protocol/crypto.ts b/client-web/source/protocol/crypto.ts
index fb34e8d..742f22c 100644
--- a/client-web/source/protocol/crypto.ts
+++ b/client-web/source/protocol/crypto.ts
@@ -3,8 +3,6 @@ import { log } from "../logger.ts";
//! I am not a crypto expert at all! Please read carefully and report any issues to me.
export async function crypto_seeded_key(seed: string): Promise<CryptoKey> {
- if (seed.length < 8) log({ scope: "crypto", warn: true }, "Room name is very short. e2ee is insecure!")
-
log("crypto", "importing seed…")
const seed_key = await window.crypto.subtle.importKey(
"raw",