mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-01 00:42:49 +08:00
Identities: compute the unique ID from the stored key instead of showing Unbekannt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
This commit is contained in:
1 parent
9e4ff35e8e
commit
bf6ab112ed
2 files changed
+123
-1
No files matched your search
+11
-1
@@ -9,6 +9,7 @@ import {
|
||||
useSyncExternalStore,
|
||||
type ReactNode,
|
||||
} from "react";
|
||||
import { identityUid } from "./identityUid";
|
||||
import qrcode from "qrcode-generator";
|
||||
import { useRegisterSW } from "virtual:pwa-register/react";
|
||||
import "./App.css";
|
||||
@@ -5596,6 +5597,15 @@ function IdentitiesDialog({
|
||||
const importInputRef = useRef<HTMLInputElement>(null);
|
||||
const [selectedId, setSelectedId] = useState(activeId ?? identities[0]?.id ?? null);
|
||||
const selected = identities.find((i) => i.id === selectedId) ?? identities[0] ?? null;
|
||||
const [computedUid, setComputedUid] = useState<string | null>(null);
|
||||
useEffect(() => {
|
||||
let current = true;
|
||||
setComputedUid(null);
|
||||
if (selected?.blob) void identityUid(selected.blob).then((uid) => current && setComputedUid(uid));
|
||||
return () => {
|
||||
current = false;
|
||||
};
|
||||
}, [selected?.blob]);
|
||||
|
||||
return (
|
||||
<div className="ts-dialog-backdrop" {...backdrop}>
|
||||
@@ -5651,7 +5661,7 @@ function IdentitiesDialog({
|
||||
{t("identities.uniqueId")}
|
||||
<input
|
||||
readOnly
|
||||
value={selected.id === activeId && ownUid ? ownUid : t("identities.unknown")}
|
||||
value={computedUid || (selected.id === activeId && ownUid) || t("identities.unknown")}
|
||||
className="ts-identities-readonly"
|
||||
/>
|
||||
</label>
|
||||
|
||||
Reference in new issue
Block a user