mirror of
https://github.com/logos-messaging/rln.waku.org.git
synced 2026-01-02 14:13:09 +00:00
chore: disable export keystore if >1 credentials
This commit is contained in:
parent
6022885144
commit
cf04f3579f
@ -63,5 +63,5 @@ If you encounter an "ERC20: insufficient allowance" error, it means the token ap
|
||||
- [x] fix rate limit fetch
|
||||
- [ ] fix membership management methods
|
||||
- [ ] define epoch / quanity epoch
|
||||
- [ ] alias for individual credentials
|
||||
- [ ] remove export keystore method (if >1 credentials in keystore)
|
||||
- [x] alias for individual credentials
|
||||
- [x] remove export keystore method (if >1 credentials in keystore)
|
||||
@ -8,7 +8,7 @@ export function KeystoreExporter() {
|
||||
const [showPasswordInput, setShowPasswordInput] = useState(false);
|
||||
const [password, setPassword] = useState("");
|
||||
const [isExporting, setIsExporting] = useState(false);
|
||||
const { exportEntireKeystore, hasStoredCredentials } = useKeystore();
|
||||
const { exportEntireKeystore, hasStoredCredentials, credentialsCount } = useKeystore();
|
||||
|
||||
const handleExport = async () => {
|
||||
if (!password) {
|
||||
@ -36,7 +36,7 @@ export function KeystoreExporter() {
|
||||
onClick={() => setShowPasswordInput(true)}
|
||||
variant="terminal"
|
||||
className="group relative overflow-hidden"
|
||||
disabled={!hasStoredCredentials}
|
||||
disabled={!hasStoredCredentials || credentialsCount > 1}
|
||||
>
|
||||
<span className="relative z-10 flex items-center">
|
||||
<ArrowUpToLine className="w-4 h-4 mr-2" />
|
||||
|
||||
@ -12,6 +12,7 @@ interface KeystoreContextType {
|
||||
error: string | null;
|
||||
hasStoredCredentials: boolean;
|
||||
storedCredentialsHashes: string[];
|
||||
credentialsCount: number;
|
||||
credentialAliases: { [hash: string]: string };
|
||||
decryptedCredentials: KeystoreEntity | null;
|
||||
hideCredentials: () => void;
|
||||
@ -241,6 +242,7 @@ export function KeystoreProvider({ children }: { children: ReactNode }) {
|
||||
error,
|
||||
hasStoredCredentials: storedCredentialsHashes.length > 0,
|
||||
storedCredentialsHashes,
|
||||
credentialsCount: storedCredentialsHashes.length,
|
||||
credentialAliases,
|
||||
saveCredentials,
|
||||
exportCredential,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user