Skip to content

Commit 2c3c882

Browse files
committed
fix: Engine wallet selector dropdown
1 parent 2d99708 commit 2c3c882

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

apps/dashboard/src/app/team/[team_slug]/(team)/~/engine/(instance)/[engineId]/overview/components/create-backend-wallet-button.tsx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,11 @@ export const CreateBackendWalletButton: React.FC<
108108
);
109109
}
110110

111-
const isAwsKmsConfigured = !!walletConfig.awsAccessKeyId;
112-
const isGcpKmsConfigured = !!walletConfig.gcpKmsKeyRingId;
113-
114111
const isNotConfigured =
115112
(["aws-kms", "smart:aws-kms"].includes(walletType) &&
116-
!isAwsKmsConfigured) ||
117-
(["gcp-kms", "smart:gcp-kms"].includes(walletType) && !isGcpKmsConfigured);
113+
!walletConfig.awsAccessKeyId) ||
114+
(["gcp-kms", "smart:gcp-kms"].includes(walletType) &&
115+
!walletConfig.gcpKmsKeyRingId);
118116

119117
return (
120118
<>
@@ -145,10 +143,9 @@ export const CreateBackendWalletButton: React.FC<
145143
tooltip={null}
146144
>
147145
<Select
148-
onValueChange={(value) => {
149-
form.reset();
150-
form.setValue("type", value as EngineBackendWalletType);
151-
}}
146+
onValueChange={(value) =>
147+
form.setValue("type", value as EngineBackendWalletType)
148+
}
152149
value={form.watch("type")}
153150
>
154151
<SelectTrigger>
@@ -177,8 +174,7 @@ export const CreateBackendWalletButton: React.FC<
177174
</FormDescription>
178175
</FormFieldSetup>
179176

180-
{(walletType === "aws-kms" && !isAwsKmsConfigured) ||
181-
(walletType === "gcp-kms" && !isGcpKmsConfigured) ? (
177+
{isNotConfigured ? (
182178
// Warning if not configured
183179
<Alert variant="warning">
184180
<CircleAlertIcon className="size-5" />

apps/dashboard/src/app/team/[team_slug]/(team)/~/engine/(instance)/[engineId]/overview/components/import-backend-wallet-button.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,9 @@ export const ImportBackendWalletButton: React.FC<
112112
invariant(selectedOption, "Selected a valid backend wallet type.");
113113

114114
// List all wallet types only if Engine is updated to support it.
115+
// Disallow importing smart backend wallets.
115116
const walletTypeOptions = supportsMultipleWalletTypes
116-
? EngineBackendWalletOptions
117+
? EngineBackendWalletOptions.filter(({ key }) => !key.startsWith("smart:"))
117118
: [selectedOption];
118119

119120
const isAwsKmsConfigured = !!walletConfig.awsAccessKeyId;

0 commit comments

Comments
 (0)