Skip to content

Commit 5e791f7

Browse files
committed
add none algorithm option
1 parent c40823f commit 5e791f7

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/features/debugger/components/debugger-alg-picker/debugger-alg-picker.component.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,18 @@ export const WidgetAlgPickerComponent: React.FC<
106106
})();
107107
}, []);
108108

109+
const noneAlgOptions: DebuggerPickerOptionModel[] = useMemo(() => {
110+
return Object.entries(
111+
jwsExampleAlgHeaderParameterValuesDictionary.unsecured,
112+
).map((entry) => {
113+
const [key, value] = entry;
114+
115+
return {
116+
value: key,
117+
label: value.name,
118+
};
119+
});
120+
}, []);
109121

110122
const symmetricAlgOptions: DebuggerPickerOptionModel[] = useMemo(() => {
111123
return Object.entries(jwsExampleAlgHeaderParameterValuesDictionary.mac).map(
@@ -172,8 +184,8 @@ export const WidgetAlgPickerComponent: React.FC<
172184
}, [canUseEd25519, canUseEd448, canUseEs512]);
173185

174186
const algOptions = useMemo(() => {
175-
return [...symmetricAlgOptions, ...asymmetricAlgOptions];
176-
}, [asymmetricAlgOptions, symmetricAlgOptions]);
187+
return [...noneAlgOptions, ...symmetricAlgOptions, ...asymmetricAlgOptions];
188+
}, [noneAlgOptions, asymmetricAlgOptions, symmetricAlgOptions]);
177189

178190
return (
179191
<div role="region" aria-label={label} className={styles.alg_picker}>

0 commit comments

Comments
 (0)