chore: cleanup context routing

This commit is contained in:
2025-05-13 09:45:23 +01:00
parent 77d70e164b
commit 3e672f9e28
3 changed files with 7 additions and 4 deletions

View File

@ -26,8 +26,10 @@ class LoginPage extends StatelessWidget {
if (result['signature'] != null) { if (result['signature'] != null) {
final key = bech32ToHex(result['signature']); final key = bech32ToHex(result['signature']);
loginData.value = LoginAccount.externalPublicKeyHex(key); loginData.value = LoginAccount.externalPublicKeyHex(key);
if (ctx.mounted) {
ctx.go("/"); ctx.go("/");
} }
}
}, },
); );
} else { } else {

View File

@ -99,7 +99,9 @@ class _NewAccountPage extends State<NewAccountPage> {
loginData.value = LoginAccount.privateKeyHex( loginData.value = LoginAccount.privateKeyHex(
_privateKey.privateKey!, _privateKey.privateKey!,
); );
if (context.mounted) {
context.go("/"); context.go("/");
}
}) })
.catchError((e) { .catchError((e) {
setState(() { setState(() {

View File

@ -1,5 +1,3 @@
import 'dart:developer' as developer;
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:ndk/ndk.dart'; import 'package:ndk/ndk.dart';
@ -327,6 +325,7 @@ class _ChatMessageWidget extends StatelessWidget {
if (reactions.isNotEmpty) if (reactions.isNotEmpty)
...reactions ...reactions
.fold(<String, Set<String>>{}, (acc, v) { .fold(<String, Set<String>>{}, (acc, v) {
// ignore: prefer_collection_literals
acc[v.content] ??= Set(); acc[v.content] ??= Set();
acc[v.content]!.add(v.pubKey); acc[v.content]!.add(v.pubKey);
return acc; return acc;