Skip to content

Commit

Permalink
Give an alert when the user tries to exceed the 1000 pgn imports per …
Browse files Browse the repository at this point in the history
…24 hours limit.
  • Loading branch information
johndoknjas committed Dec 19, 2024
1 parent df31833 commit 4d8c6df
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ui/analyse/src/study/chapterNewForm.ts
Original file line number Diff line number Diff line change
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

0 comments on commit 4d8c6df

Please sign in to comment.