INNER CODE UNIT · TypeScript
destination
SimonAKing/scrcpy-gui · src/main/main.ts:452
const destination = await dialog.showSaveDialog({
title: 'Export redacted diagnostic bundle',
defaultPath: join(app.getPath('downloads'), `scrcpy-gui-diagnostics-${timestamp}.zip`),
filters: [{ name: 'ZIP archive', extensions: ['zip'] }]
})
if (destination.canceled || !destination.filePath) {
return operationFailure('DIAGNOSTIC_EXPORT_CANCELED', 'diagnostic-export', 'Diagnostic export canceled.')
}
await diagnosticsService.write(destination.filePath, prepared)
const artifact = await artifactService.register({
kind: 'diagnostic', path: destination.filePath,
metadata: { appVersion: app.getVersion(), eventCount: prepared.preview.eventCount, redacted: true }
})
diagnosticDraft = undefined
eventStore.publish({
level: 'info', domain: 'artifact', action: 'diagnostic-exported', stage: 'complete',
message: 'Redacted diagnostic bundle exported.', data: { artifactId: artifact.id, size: artifact.size }
})