show encrypted seed only when passphrase is not empty

This commit is contained in:
Czarek Nakamoto 2024-08-23 17:45:59 +02:00
parent 779b35f642
commit 38006b6380
2 changed files with 5 additions and 3 deletions

View file

@ -43,7 +43,8 @@ String getSeed() {
final lang = PolyseedLang.getByPhrase(cakepassphrase);
final coin = PolyseedCoin.POLYSEED_MONERO;
final ps = Polyseed.decode(cakepolyseed, lang, coin);
if (ps.isEncrypted) return ps.encode(lang, coin);
final passphrase = getPassphrase();
if (ps.isEncrypted || passphrase == "") return ps.encode(lang, coin);
ps.crypt(getPassphrase());
return ps.encode(lang, coin);
}

View file

@ -45,8 +45,9 @@ String getSeed() {
final lang = PolyseedLang.getByPhrase(cakepassphrase);
final coin = PolyseedCoin.POLYSEED_MONERO;
final ps = Polyseed.decode(cakepolyseed, lang, coin);
if (ps.isEncrypted) return ps.encode(lang, coin);
ps.crypt(getPassphrase());
final passphrase = getPassphrase();
if (ps.isEncrypted || passphrase == "") return ps.encode(lang, coin);
ps.crypt(passphrase);
return ps.encode(lang, coin);
}
return cakepolyseed;