diff --git a/ui/analyse/src/study/chapterNewForm.ts b/ui/analyse/src/study/chapterNewForm.ts index 459cc9d332578..3d0ad5d5a8d43 100644 --- a/ui/analyse/src/study/chapterNewForm.ts +++ b/ui/analyse/src/study/chapterNewForm.ts @@ -1,6 +1,6 @@ import { parseFen } from 'chessops/fen'; import { defined, prop, type Prop, toggle } from 'common'; -import { snabDialog } from 'common/dialog'; +import { snabDialog, alert } from 'common/dialog'; import * as licon from 'common/licon'; import { bind, bindSubmit, onInsert, looseH as h, dataIcon, type VNode } from 'common/snabbdom'; import { storedProp } from 'common/storage'; @@ -85,7 +85,11 @@ export class StudyChapterNewForm { const study = this.root.study!; const dd = { ...d, sticky: study.vm.mode.sticky, initial: this.initial() }; if (!dd.pgn) this.send('addChapter', dd); - else importPgn(study.data.id, dd); + else + importPgn(study.data.id, dd).catch(e => { + if (e.message === 'Too many requests') alert('Limit of 1000 pgn imports every 24 hours'); + throw e; + }); this.isOpen(false); this.setChaptersTab(); };