mirror of
https://github.com/logos-messaging/rln.waku.org.git
synced 2026-01-07 16:43:05 +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
|
- [x] fix rate limit fetch
|
||||||
- [ ] fix membership management methods
|
- [ ] fix membership management methods
|
||||||
- [ ] define epoch / quanity epoch
|
- [ ] define epoch / quanity epoch
|
||||||
- [ ] alias for individual credentials
|
- [x] alias for individual credentials
|
||||||
- [ ] remove export keystore method (if >1 credentials in keystore)
|
- [x] remove export keystore method (if >1 credentials in keystore)
|
||||||
@ -8,7 +8,7 @@ export function KeystoreExporter() {
|
|||||||
const [showPasswordInput, setShowPasswordInput] = useState(false);
|
const [showPasswordInput, setShowPasswordInput] = useState(false);
|
||||||
const [password, setPassword] = useState("");
|
const [password, setPassword] = useState("");
|
||||||
const [isExporting, setIsExporting] = useState(false);
|
const [isExporting, setIsExporting] = useState(false);
|
||||||
const { exportEntireKeystore, hasStoredCredentials } = useKeystore();
|
const { exportEntireKeystore, hasStoredCredentials, credentialsCount } = useKeystore();
|
||||||
|
|
||||||
const handleExport = async () => {
|
const handleExport = async () => {
|
||||||
if (!password) {
|
if (!password) {
|
||||||
@ -36,7 +36,7 @@ export function KeystoreExporter() {
|
|||||||
onClick={() => setShowPasswordInput(true)}
|
onClick={() => setShowPasswordInput(true)}
|
||||||
variant="terminal"
|
variant="terminal"
|
||||||
className="group relative overflow-hidden"
|
className="group relative overflow-hidden"
|
||||||
disabled={!hasStoredCredentials}
|
disabled={!hasStoredCredentials || credentialsCount > 1}
|
||||||
>
|
>
|
||||||
<span className="relative z-10 flex items-center">
|
<span className="relative z-10 flex items-center">
|
||||||
<ArrowUpToLine className="w-4 h-4 mr-2" />
|
<ArrowUpToLine className="w-4 h-4 mr-2" />
|
||||||
|
|||||||
@ -12,6 +12,7 @@ interface KeystoreContextType {
|
|||||||
error: string | null;
|
error: string | null;
|
||||||
hasStoredCredentials: boolean;
|
hasStoredCredentials: boolean;
|
||||||
storedCredentialsHashes: string[];
|
storedCredentialsHashes: string[];
|
||||||
|
credentialsCount: number;
|
||||||
credentialAliases: { [hash: string]: string };
|
credentialAliases: { [hash: string]: string };
|
||||||
decryptedCredentials: KeystoreEntity | null;
|
decryptedCredentials: KeystoreEntity | null;
|
||||||
hideCredentials: () => void;
|
hideCredentials: () => void;
|
||||||
@ -241,6 +242,7 @@ export function KeystoreProvider({ children }: { children: ReactNode }) {
|
|||||||
error,
|
error,
|
||||||
hasStoredCredentials: storedCredentialsHashes.length > 0,
|
hasStoredCredentials: storedCredentialsHashes.length > 0,
|
||||||
storedCredentialsHashes,
|
storedCredentialsHashes,
|
||||||
|
credentialsCount: storedCredentialsHashes.length,
|
||||||
credentialAliases,
|
credentialAliases,
|
||||||
saveCredentials,
|
saveCredentials,
|
||||||
exportCredential,
|
exportCredential,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user