refactor: cleanup

This commit is contained in:
zhom
2026-09-08 07:04:14 +04:00
parent c417c669c4
commit 598d3bd513
11 changed files with 250 additions and 253 deletions
-1
View File
@@ -120,7 +120,6 @@ export function WayfernConfigForm({
result.identity_id ? undefined : result.fingerprint,
);
onConfigChange("identity_overrides", undefined);
onConfigChange("identity_baseline", undefined);
} catch (error) {
console.error("Failed to generate fingerprint:", error);
} finally {
+4 -8
View File
@@ -74,14 +74,10 @@ export function useGroupEvents() {
void setupListeners();
// Cleanup listeners on unmount.
// NOTE: the previous version stored both unlisten fns by reassigning
// `groupsUnlisten` to a wrapper that called itself, which produced a
// `Maximum call stack size exceeded` crash whenever this effect tore
// down. React's reconciler then bailed out mid-commit and left stale
// overlay nodes in the DOM, blocking every subsequent click in the
// window. Holding the two unlisten fns in separate locals avoids both
// problems.
// Cleanup listeners on unmount. The two unlisten fns stay in separate
// locals: merging them into one wrapper that reassigns the local it then
// calls makes that wrapper call itself, and the stack overflow aborts the
// teardown mid-commit, leaving stale overlay nodes that swallow clicks.
return () => {
if (groupsUnlisten) groupsUnlisten();
if (profilesUnlisten) profilesUnlisten();
-1
View File
@@ -414,7 +414,6 @@ export interface WayfernConfig {
os?: WayfernOS; // Operating system for fingerprint generation
geo_proxy_signature?: string; // Internal: routing the fingerprint's location was computed for
identity_id?: string; // Internal: UUID the device is derived from on browsers with the identity API
identity_baseline?: string; // Legacy: read once by the migration to identity-only storage, never written
identity_overrides?: string; // JSON object of the user's own edits to an identity-backed device
location?: string; // JSON object of the exit-derived location fields (timezone, language, coordinates)
}