Skip to content

Commit f8fc4d2

Browse files
committed
resolve lint errors and clean up dead code
1 parent 83ad080 commit f8fc4d2

5 files changed

Lines changed: 15 additions & 32 deletions

File tree

src/components/AddShare.tsx

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -414,23 +414,10 @@ const AddShare: React.FC<AddShareProps> = ({ onComplete, onCancel }) => {
414414

415415
const relays = relayPlanResult.relayPlan.relays;
416416

417-
// Enable verbose echo logging only when explicitly requested and when
418-
// a Node-like `process` global is available (renderer may not have it).
419-
const debugEnv = typeof process !== 'undefined' ? process.env.IGLOO_DEBUG_ECHO : undefined;
420-
const debugEnabled = ((debugEnv ?? '').toLowerCase() === '1' || (debugEnv ?? '').toLowerCase() === 'true');
421-
422417
await sendEcho(groupCredential, shareCredential, challenge, {
423418
relays,
424419
timeout: 10000,
425-
// Bubble up debug logs if requested; guard access to process.env
426-
eventConfig: debugEnabled
427-
? {
428-
enableLogging: true,
429-
customLogger: (level: string, message: string, data?: unknown) => {
430-
console.log(`[echo-send] ${level.toUpperCase()} ${message}`, data ?? '');
431-
}
432-
}
433-
: undefined
420+
// Debug logging not available in renderer (process.env inaccessible with contextIsolation)
434421
});
435422

436423
console.log('Echo sent successfully');

src/components/Recover.tsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -479,20 +479,15 @@ const Recover: React.FC<RecoverProps> = ({
479479
}, []);
480480

481481
// Cleanup timeouts on unmount
482+
// Note: Accessing .current in cleanup is intentional for timeout refs -
483+
// we want to clear whatever timeout is active at unmount time.
482484
useEffect(() => {
483485
return () => {
484-
if (nsecClearTimeoutRef.current) {
485-
clearTimeout(nsecClearTimeoutRef.current);
486-
}
487-
if (copiedTimeoutRef.current) {
488-
clearTimeout(copiedTimeoutRef.current);
489-
}
490-
if (copyErrorTimeoutRef.current) {
491-
clearTimeout(copyErrorTimeoutRef.current);
492-
}
493-
if (autofilledTimeoutRef.current) {
494-
clearTimeout(autofilledTimeoutRef.current);
495-
}
486+
if (nsecClearTimeoutRef.current) clearTimeout(nsecClearTimeoutRef.current);
487+
if (copiedTimeoutRef.current) clearTimeout(copiedTimeoutRef.current);
488+
if (copyErrorTimeoutRef.current) clearTimeout(copyErrorTimeoutRef.current);
489+
// eslint-disable-next-line react-hooks/exhaustive-deps
490+
if (autofilledTimeoutRef.current) clearTimeout(autofilledTimeoutRef.current);
496491
};
497492
}, []);
498493

src/lib/signer-keepalive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export function createSignerKeepAlive(config: KeepAliveConfig): SignerKeepAliveH
7171
groupCredential,
7272
shareCredential,
7373
relays,
74-
selfPubkey,
74+
// selfPubkey available in config but not currently used
7575
} = config;
7676

7777
const logger: KeepAliveLogger = rawLogger ?? (() => undefined);

src/main.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ function sanitizeErrorForLog(error: unknown): string {
3434
const message = error instanceof Error ? error.message : String(error);
3535
return message
3636
// Quoted Unix paths: '/path/with spaces/file.txt' -> '<path>/file.txt'
37-
.replace(/(['"])(\/(?:[^\/]+\/)+)([^\/'"]*)\1/g, '$1<path>/$3$1')
37+
.replace(/(['"])(\/(?:[^/]+\/)+)([^/'"]*)\1/g, '$1<path>/$3$1')
3838
// Unquoted Unix paths: /path/to/file.txt -> <path>/file.txt
39-
.replace(/\/(?:[^\/\s:]+\/)+([^\/\s:]+)/g, '<path>/$1')
39+
.replace(/\/(?:[^/\s:]+\/)+([^/\s:]+)/g, '<path>/$1')
4040
// Quoted Windows paths: "C:\path\with spaces\file.txt" -> "<path>\file.txt"
4141
.replace(/(['"])([A-Za-z]:\\(?:[^\\]+\\)+)([^\\'"]*)(\1)/g, '$1<path>\\$3$1')
4242
// Unquoted Windows paths: C:\path\to\file.txt -> <path>\file.txt
@@ -426,7 +426,7 @@ app.whenReady().then(() => {
426426
const existing = activeEchoListeners.get(listenerId);
427427
try {
428428
existing?.cleanup?.();
429-
} catch (err) {
429+
} catch {
430430
console.warn('[EchoBridge] Failed to cleanup existing listener during start', { listenerId });
431431
} finally {
432432
activeEchoListeners.delete(listenerId);

src/preload.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
import { contextBridge, ipcRenderer } from 'electron';
12+
import type { IpcRendererEvent } from 'electron';
1213
import type { RelayPlan } from '@/types';
1314

1415
// Type definitions for the exposed API
@@ -118,7 +119,7 @@ contextBridge.exposeInMainWorld('electronAPI', {
118119
console.error('[preload] onEchoReceived requires a function callback');
119120
return () => {}; // Return no-op cleanup
120121
}
121-
const handler = (_event: Electron.IpcRendererEvent, data: unknown) => {
122+
const handler = (_event: IpcRendererEvent, data: unknown) => {
122123
if (isEchoReceivedData(data)) {
123124
callback(data);
124125
} else {
@@ -138,7 +139,7 @@ contextBridge.exposeInMainWorld('electronAPI', {
138139
console.error('[preload] onEchoError requires a function callback');
139140
return () => {}; // Return no-op cleanup
140141
}
141-
const handler = (_event: Electron.IpcRendererEvent, data: unknown) => {
142+
const handler = (_event: IpcRendererEvent, data: unknown) => {
142143
if (isEchoErrorData(data)) {
143144
callback(data);
144145
} else {

0 commit comments

Comments
 (0)