style: improve code formatting and type safety
- Add proper type annotation for onDetect result parameter - Fix indentation and line wrapping in template - Remove unused WebInlineQRScanner import - Clean up button attribute ordering - Fix whitespace and formatting issues - Remove unused empty divs
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import { EventEmitter } from "events";
|
||||
|
||||
export interface QRScannerListener {
|
||||
onScan: (result: string) => void;
|
||||
onError: (error: Error) => void;
|
||||
@@ -14,4 +12,4 @@ export interface QRScannerService {
|
||||
addListener(listener: QRScannerListener): void;
|
||||
cleanup(): Promise<void>;
|
||||
onStream(callback: (stream: MediaStream | null) => void): void;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,10 +156,10 @@ export class WebInlineQRScanner implements QRScannerService {
|
||||
|
||||
try {
|
||||
logger.log("[WebInlineQRScanner] Stopping scan");
|
||||
|
||||
|
||||
// Stop all tracks in the stream
|
||||
if (this.stream) {
|
||||
this.stream.getTracks().forEach(track => track.stop());
|
||||
this.stream.getTracks().forEach((track) => track.stop());
|
||||
this.stream = null;
|
||||
}
|
||||
|
||||
@@ -192,4 +192,4 @@ export class WebInlineQRScanner implements QRScannerService {
|
||||
logger.error("Error during cleanup:", error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user