Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions ui/analyse/src/study/chapterNewForm.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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();
};
Expand Down
Loading