MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / constructor

Method constructor

src/lib/auth.js:52–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50 #loginTimeout = null;
51
52 constructor() {
53 addIntentHandler(this.onIntentReceiver.bind(this));
54 loginEvents.addListener(() => {
55 clearTimeout(this.#loginTimeout);
56 for (const callback of this.#loginCallbacks) {
57 callback.resolve();
58 }
59 this.#loginCallbacks.clear();
60 });
61 document.addEventListener("resume", () => {
62 clearTimeout(this.#loginTimeout);
63 this.#loginTimeout = setTimeout(() => {
64 for (const callback of this.#loginCallbacks) {
65 callback.reject("Login timed out");
66 }
67
68 this.#loginCallbacks.clear();
69 }, 1000);
70 });
71 }
72
73 async onIntentReceiver(event) {
74 try {

Callers

nothing calls this directly

Calls 2

addIntentHandlerFunction · 0.90
clearMethod · 0.45

Tested by

no test coverage detected