fix(auth): code display for new codes

This commit is contained in:
Prateek Sunal 2024-05-07 19:01:39 +05:30
parent 62441b86bd
commit 54f6f8656d

View file

@ -261,7 +261,8 @@ class _SetupEnterSecretKeyPageState extends State<SetupEnterSecretKeyPage> {
return;
}
}
final CodeDisplay display = widget.code!.display.copyWith(tags: tags);
final CodeDisplay display =
widget.code?.display.copyWith(tags: tags) ?? CodeDisplay(tags: tags);
final Code newCode = widget.code == null
? Code.fromAccountAndSecret(
isStreamCode ? Type.steam : Type.totp,