File size: 638 Bytes
ebdfd67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import React, { useEffect } from "react";

function KeyboardShortcuts() {
  useEffect(() => {
    const handleKeyDown = (e) => {
      if (e.key === "p") {
        console.log("Debug key pressed: Clearing auth data and refreshing");
        localStorage.removeItem("hf_oauth");
        localStorage.removeItem("auth_return_to");
        alert("Auth data cleared. Page will reload.");
        window.location.reload();
      }
    };

    window.addEventListener("keydown", handleKeyDown);
    return () => {
      window.removeEventListener("keydown", handleKeyDown);
    };
  }, []);

  return null;
}

export default KeyboardShortcuts;