| 1350 | /** | 1350 | /** |
| 1351 | * Checks if the response contains a quota error and displays a popup if it does. | 1351 | * Checks if the response contains a quota error and displays a popup if it does. |
| 1352 | * @param data | 1352 | * @param data |
| 1353 | * @returns {Promise<void>} | 1353 | * @returns {void} |
| 1354 | * @throws {object} - response JSON | 1354 | * @throws {object} - response JSON |
| 1355 | */ | 1355 | */ |
| 1356 | async function checkQuotaError(data) { | 1356 | function checkQuotaError(data) { |
| 1357 | const errorText = await renderTemplateAsync('quotaError'); | | |
| 1358 | | | |
| 1359 | if (!data) { | 1357 | if (!data) { |
| 1360 | return; | 1358 | return; |
| 1361 | } | 1359 | } |
| 1362 | | 1360 | |
| 1363 | if (data.quota_error) { | 1361 | if (data.quota_error) { |
| 1364 | callPopup(errorText, 'text'); | 1362 | renderTemplateAsync('quotaError').then((html) => Popup.show.text('Quota Error', html)); |
| 1365 | | 1363 | |
| 1366 | // this does not throw correctly (equiv to Error("[object Object]")) | 1364 | // this does not throw correctly (equiv to Error("[object Object]")) |
| 1367 | // if trying to fix "[object Object]" displayed to users, start here | 1365 | // if trying to fix "[object Object]" displayed to users, start here |