style: 代码格式优化

This commit is contained in:
digua
2026-04-06 21:04:05 +08:00
committed by digua
parent bfc96a723d
commit 3189de3a6e
34 changed files with 218 additions and 261 deletions
+13 -7
View File
@@ -23,7 +23,9 @@ function getTempFilePath(ext: string): string {
function cleanupTempFile(filePath: string): void {
try {
if (fs.existsSync(filePath)) fs.unlinkSync(filePath)
} catch { /* ignore */ }
} catch {
/* ignore */
}
}
function notifySessionListChanged(): void {
@@ -33,7 +35,9 @@ function notifySessionListChanged(): void {
for (const win of wins) {
win.webContents.send('api:importCompleted')
}
} catch { /* ignore */ }
} catch {
/* ignore */
}
}
function notifyPullResult(dsId: string, status: 'success' | 'error', detail: string): void {
@@ -43,7 +47,9 @@ function notifyPullResult(dsId: string, status: 'success' | 'error', detail: str
for (const win of wins) {
win.webContents.send('api:pullResult', { dsId, status, detail })
}
} catch { /* ignore */ }
} catch {
/* ignore */
}
}
/**
@@ -51,9 +57,7 @@ function notifyPullResult(dsId: string, status: 'success' | 'error', detail: str
*/
async function fetchToTempFile(ds: DataSource): Promise<string> {
return new Promise<string>((resolve, reject) => {
const url = ds.url.includes('?')
? `${ds.url}&since=${ds.lastPullAt}`
: `${ds.url}?since=${ds.lastPullAt}`
const url = ds.url.includes('?') ? `${ds.url}&since=${ds.lastPullAt}` : `${ds.url}?since=${ds.lastPullAt}`
const request = net.request(url)
@@ -140,7 +144,9 @@ async function executePull(ds: DataSource): Promise<void> {
if (result.success) {
try {
await worker.generateIncrementalSessions(ds.targetSessionId)
} catch { /* ignore */ }
} catch {
/* ignore */
}
}
} else {
result = await worker.streamImport(tempFile)