Skip to content

Commit 0bef1b6

Browse files
committed
Fix/export exception to empty revlog
1 parent 0b70cd7 commit 0bef1b6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/components/menu/submit/ExportSubmit.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ export default function ExportSubmitButton({ action }: { action: () => Promise<E
1818
setLoading(true)
1919
const data = await action();
2020
const logs = data.revlogs
21+
if(logs.length === 0){
22+
alert("No logs to export")
23+
setLoading(false)
24+
return;
25+
}
2126
const GMT = -data.offset / 60
2227
const head = Object.keys(logs[0]).join(',') + '\n'
2328
const body = logs.map(log => Object.values(log).join(',')).join('\n')

0 commit comments

Comments
 (0)