Skip to content

Commit

Permalink
Merge pull request #684 from threefoldtech/development_disable_update…
Browse files Browse the repository at this point in the history
…_SSH

Disable updateSSH on low balance
  • Loading branch information
AhmedHanafy725 authored Jun 25, 2023
2 parents 675592b + 1160c8b commit 000bfd6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/playground/src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ export function normalizeBalance(num: number | string | undefined, floor = false
return (+num).toFixed(3).replace(/0+$/g, "");
}

export function isEnoughBalance(balance: any): boolean {
return balance.free > 0.001 ? true : false;
export function isEnoughBalance(balance: any, min = 0.001): boolean {
return balance.free > min ? true : false;
}
2 changes: 1 addition & 1 deletion packages/playground/src/weblets/profile_manager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
color="primary"
variant="text"
@click="updateSSH"
:disabled="!ssh || profileManager.profile.ssh === ssh || updatingSSH"
:disabled="!ssh || profileManager.profile.ssh === ssh || updatingSSH || !isEnoughBalance(balance)"
:loading="updatingSSH"
>
Update Public SSH Key
Expand Down

0 comments on commit 000bfd6

Please sign in to comment.