diff --git a/frontend/src/ts/popups/quote-search-popup.ts b/frontend/src/ts/popups/quote-search-popup.ts index ab8fb46a1..559b329e1 100644 --- a/frontend/src/ts/popups/quote-search-popup.ts +++ b/frontend/src/ts/popups/quote-search-popup.ts @@ -319,10 +319,28 @@ $("#quoteSearchPopupWrapper").on("mousedown", (e) => { } }); -$("#popups").on("click", "#quoteSearchPopup #gotoSubmitQuoteButton", () => { - hide(); - QuoteSubmitPopup.show(true); -}); +$("#popups").on( + "click", + "#quoteSearchPopup #gotoSubmitQuoteButton", + async () => { + Loader.show(); + const isSubmissionEnabled = (await Ape.quotes.isSubmissionEnabled()).data + .isEnabled; + Loader.hide(); + if (!isSubmissionEnabled) { + Notifications.add( + "Quote submission is disabled temporarily due to a large submission queue.", + 0, + { + duration: 5, + } + ); + return; + } + hide(); + QuoteSubmitPopup.show(true); + } +); $("#popups").on("click", "#quoteSearchPopup #goToApproveQuotes", () => { hide(); diff --git a/frontend/src/ts/popups/quote-submit-popup.ts b/frontend/src/ts/popups/quote-submit-popup.ts index 5fb8bd610..0f426db5c 100644 --- a/frontend/src/ts/popups/quote-submit-popup.ts +++ b/frontend/src/ts/popups/quote-submit-popup.ts @@ -49,18 +49,6 @@ async function submitQuote(): Promise { } export async function show(noAnim = false): Promise { - const isSubmissionEnabled = (await Ape.quotes.isSubmissionEnabled()).data - .isEnabled; - if (!isSubmissionEnabled) { - Notifications.add( - "Quote submission is disabled temporarily due to a large submission queue.", - 0, - { - duration: 5, - } - ); - return; - } Skeleton.append(wrapperId); if (!Misc.isPopupVisible(wrapperId)) {