Skip to content

Commit

Permalink
fix(ui): TE-XXXX quota negative value fix (#1762)
Browse files Browse the repository at this point in the history
* fix(ui): TE-XXXX quota negative value fix

* detection check fix
  • Loading branch information
nalin-patidar authored Jan 21, 2025
1 parent 5b3ebc6 commit a8ad5a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,16 @@ export const AppBarConfigProvider: FunctionComponent<AppBarConfigProviderProps>
startTime: startOfMonth,
});
setRemainingQuota({
notification:
notification: Math.max(
taskQuotasConfiguration.maximumNotificationTasksPerMonth! -
notificationUsage.count,
detection:
notificationUsage.count,
0
),
detection: Math.max(
taskQuotasConfiguration.maximumDetectionTasksPerMonth! -
detectionUsage.count,
detectionUsage.count,
0
),
});
} catch (e) {
notifyIfErrors(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ export const CreateAlertModal: FunctionComponent<CreateAlertModalModalProps> =
}, [defaultCron]);

const checkQuota = (): void => {
if (
remainingQuota?.notification &&
remainingQuota?.notification <= 0
) {
if (remainingQuota?.detection && remainingQuota?.detection <= 0) {
showDialog({
type: DialogType.ALERT,
contents: (
Expand Down

0 comments on commit a8ad5a6

Please sign in to comment.