From 4d8c6dfb03f7f79a26db75c00990edf0df24fad4 Mon Sep 17 00:00:00 2001 From: johndoknjas Date: Thu, 19 Dec 2024 03:09:58 -0800 Subject: [PATCH] Give an alert when the user tries to exceed the 1000 pgn imports per 24 hours limit. --- ui/analyse/src/study/chapterNewForm.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/analyse/src/study/chapterNewForm.ts b/ui/analyse/src/study/chapterNewForm.ts index 459cc9d332578..6a3b21cb1773c 100644 --- a/ui/analyse/src/study/chapterNewForm.ts +++ b/ui/analyse/src/study/chapterNewForm.ts @@ -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(); };