Skip to content

Commit 0332ffb

Browse files
committed
fix: Edge cases when restarting or applying licenses
1 parent f9157c5 commit 0332ffb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/hooks/useApplyLicensesClick.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export function useApplyLicensesClick({ licenses }: ApplyLicensesClickParams): A
6262
});
6363
licensesApplied += 1;
6464
} catch {
65-
if (i !== licenses.length) {
65+
if (i + 1 !== licenses.length) {
6666
// If it fails to applyLicenses, or wasn't available, warn for a bit then move on.
6767
toast.loading(`Failed Applying License ${i + 1} of ${licenses.length}`, {
6868
...toastConfig,
@@ -103,7 +103,7 @@ export function useApplyLicensesClick({ licenses }: ApplyLicensesClickParams): A
103103
id: toastId,
104104
description: `${licenseWord} not applied.\n`
105105
+ [
106-
licenses.length !== licensesApplied && `${licensesApplied} of ${licenses.length} ${licenseWord.toLowerCase()} applied.`,
106+
licensesApplied > 0 && licenses.length !== licensesApplied && `${licensesApplied} of ${licenses.length} ${licenseWord.toLowerCase()} applied.`,
107107
].filter(excludeFalsy)[0],
108108
duration: 10_000,
109109
action: {

src/hooks/useRestartClusterClick.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export function useRestartClusterClick({ onRestartedSuccessfully }: RestartClust
7878
instancesRestarted += 1;
7979
}
8080
catch {
81-
if (i !== instanceClients.length) {
81+
if (i + 1 !== instanceClients.length) {
8282
// If it fails to restart, or wasn't available, warn for a bit then move on.
8383
toast.loading(`Failed Restarting Instance ${i + 1} of ${instanceClients.length}`, {
8484
...toastConfig,

0 commit comments

Comments
 (0)