mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-09-26 17:52:59 +02:00
Replace empty arrow functions with explicit comments
Updated all empty arrow functions and constructors to include an explicit '/* empty */' comment for clarity and consistency. Also fixed a minor HTML entity in SwaggerUI and removed unnecessary async/Promise usage in some service methods.
This commit is contained in:
parent
4c8ae23652
commit
1c95c6a2e8
@ -21,7 +21,7 @@ export function adjustFontSizeToFit(
|
||||
element: HTMLElement,
|
||||
options: AdjustFontSizeOptions = {}
|
||||
): () => void {
|
||||
if (!element) return () => {};
|
||||
if (!element) return () => { /* empty */ };
|
||||
|
||||
const computed = window.getComputedStyle(element);
|
||||
const baseFontPx = options.maxFontSizePx ?? parseFloat(computed.fontSize || '16');
|
||||
|
@ -150,7 +150,7 @@ export default function ToolSelector({
|
||||
<div onClick={handleSearchFocus} style={{ cursor: 'pointer',
|
||||
borderRadius: "var(--mantine-radius-lg)" }}>
|
||||
<ToolButton id='tool' tool={toolRegistry[selectedValue]} isSelected={false}
|
||||
onSelect={()=>{}} rounded={true} disableNavigation={true}></ToolButton>
|
||||
onSelect={()=>{ /* empty */ }} rounded={true} disableNavigation={true}></ToolButton>
|
||||
</div>
|
||||
) : (
|
||||
// Show search input when no tool selected OR when dropdown is opened
|
||||
|
@ -166,9 +166,9 @@ export function useFileContext() {
|
||||
addFiles: actions.addFiles,
|
||||
consumeFiles: actions.consumeFiles,
|
||||
undoConsumeFiles: actions.undoConsumeFiles,
|
||||
recordOperation: (_fileId: FileId, _operation: any) => {}, // Operation tracking not implemented
|
||||
markOperationApplied: (_fileId: FileId, _operationId: string) => {}, // Operation tracking not implemented
|
||||
markOperationFailed: (_fileId: FileId, _operationId: string, _error: string) => {}, // Operation tracking not implemented
|
||||
recordOperation: (_fileId: FileId, _operation: any) => { /* empty */ }, // Operation tracking not implemented
|
||||
markOperationApplied: (_fileId: FileId, _operationId: string) => { /* empty */ }, // Operation tracking not implemented
|
||||
markOperationFailed: (_fileId: FileId, _operationId: string, _error: string) => { /* empty */ }, // Operation tracking not implemented
|
||||
// File ID lookup
|
||||
findFileId: (file: File) => {
|
||||
return state.files.ids.find(id => {
|
||||
|
@ -57,7 +57,7 @@ describe('useAdjustPageScaleParameters', () => {
|
||||
test.each([
|
||||
{
|
||||
description: 'with default parameters',
|
||||
setup: () => {},
|
||||
setup: () => { /* empty */ },
|
||||
expected: true
|
||||
},
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ export function useFileWithUrlAndCleanup(file: File | null): {
|
||||
cleanup: () => void;
|
||||
} {
|
||||
return useMemo(() => {
|
||||
if (!file) return { fileObj: null, cleanup: () => {} };
|
||||
if (!file) return { fileObj: null, cleanup: () => { /* empty */ } };
|
||||
|
||||
const url = URL.createObjectURL(file);
|
||||
const fileObj = { file, url };
|
||||
|
@ -16,7 +16,7 @@ export function useToolParameters(
|
||||
|
||||
// Return empty values and noop updater
|
||||
const currentValues = useMemo(() => ({}), []);
|
||||
const updateParameters = useCallback(() => {}, []);
|
||||
const updateParameters = useCallback(() => { /* empty */ }, []);
|
||||
|
||||
return [currentValues, updateParameters];
|
||||
}
|
||||
@ -45,7 +45,7 @@ export function useToolParameter<T = any>(
|
||||
*/
|
||||
export function useGlobalParameters() {
|
||||
const currentValues = useMemo(() => ({}), []);
|
||||
const updateParameters = useCallback(() => {}, []);
|
||||
const updateParameters = useCallback(() => { /* empty */ }, []);
|
||||
|
||||
return [currentValues, updateParameters];
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ export class EnhancedPDFProcessingService {
|
||||
maxRetries: 3
|
||||
};
|
||||
|
||||
private constructor() {}
|
||||
private constructor() { /* empty */ }
|
||||
|
||||
static getInstance(): EnhancedPDFProcessingService {
|
||||
if (!EnhancedPDFProcessingService.instance) {
|
||||
|
@ -24,7 +24,7 @@ class IndexedDBManager {
|
||||
private databases = new Map<string, IDBDatabase>();
|
||||
private initPromises = new Map<string, Promise<IDBDatabase>>();
|
||||
|
||||
private constructor() {}
|
||||
private constructor() { /* empty */ }
|
||||
|
||||
static getInstance(): IndexedDBManager {
|
||||
if (!IndexedDBManager.instance) {
|
||||
|
@ -210,7 +210,7 @@ export class PDFExportService {
|
||||
/**
|
||||
* Download multiple files as a ZIP
|
||||
*/
|
||||
async downloadAsZip(blobs: Blob[], filenames: string[]): Promise<void> {
|
||||
downloadAsZip(blobs: Blob[], filenames: string[]): void {
|
||||
blobs.forEach((blob, index) => {
|
||||
setTimeout(() => {
|
||||
this.downloadFile(blob, filenames[index]);
|
||||
|
@ -9,7 +9,7 @@ export class PDFProcessingService {
|
||||
private processing = new Map<string, ProcessingState>();
|
||||
private processingListeners = new Set<(states: Map<string, ProcessingState>) => void>();
|
||||
|
||||
private constructor() {}
|
||||
private constructor() { /* empty */ }
|
||||
|
||||
static getInstance(): PDFProcessingService {
|
||||
if (!PDFProcessingService.instance) {
|
||||
@ -18,7 +18,7 @@ export class PDFProcessingService {
|
||||
return PDFProcessingService.instance;
|
||||
}
|
||||
|
||||
async getProcessedFile(file: File): Promise<ProcessedFile | null> {
|
||||
getProcessedFile(file: File): ProcessedFile | null {
|
||||
const fileKey = this.generateFileKey(file);
|
||||
|
||||
// Check cache first
|
||||
|
@ -12,7 +12,7 @@ const SwaggerUI: React.FC<BaseToolProps> = () => {
|
||||
<div style={{ textAlign: "center", padding: "2rem" }}>
|
||||
<p>Opening Swagger UI in a new tab...</p>
|
||||
<p>
|
||||
If it didn't open automatically,{" "}
|
||||
If it didn't open automatically,{" "}
|
||||
<a href={withBasePath("/swagger-ui/5.21.0/index.html")} target="_blank" rel="noopener noreferrer">
|
||||
click here
|
||||
</a>
|
||||
|
Loading…
Reference in New Issue
Block a user