mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-24 08:01:56 -05:00
fix(client): get-sesion gets triggered twice on foucs
This commit is contained in:
@@ -31,19 +31,15 @@ class WindowFocusManager implements FocusManager {
|
||||
return () => {};
|
||||
}
|
||||
|
||||
const onFocus = () => this.setFocused(true);
|
||||
|
||||
const visibilityHandler = () => {
|
||||
if (document.visibilityState === "visible") {
|
||||
this.setFocused(true);
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener("focus", onFocus, false);
|
||||
document.addEventListener("visibilitychange", visibilityHandler, false);
|
||||
|
||||
return () => {
|
||||
window.removeEventListener("focus", onFocus, false);
|
||||
document.removeEventListener(
|
||||
"visibilitychange",
|
||||
visibilityHandler,
|
||||
|
||||
Reference in New Issue
Block a user