Skip to content

Commit

Permalink
better easyloading infos
Browse files Browse the repository at this point in the history
  • Loading branch information
frnandu committed Jan 1, 2024
1 parent 7f7b69b commit 0bdac6c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ Future<void> initRelays({bool newKey = false}) async {
if (settingProvider.gossip == 1) {
feedRelaySet = relayManager.getRelaySet("feed", loggedUserSigner!.getPublicKey());
if (feedRelaySet == null) {
EasyLoading.showToast("Calculating feed relays from contact's outboxes...", dismissOnTap: true, duration: const Duration(seconds: 15), maskType: EasyLoadingMaskType.black);

feedRelaySet = await relayManager.calculateRelaySet(
name: "feed",
ownerPubKey: loggedUserSigner!.getPublicKey(),
Expand Down
6 changes: 3 additions & 3 deletions lib/router/index/account_manager_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class AccountsState extends State<AccountsComponent> {
}

static void doLogin() async {
EasyLoading.show(status: "Logging in...",maskType: EasyLoadingMaskType.black);
EasyLoading.show(status: "Logging in...",maskType: EasyLoadingMaskType.black, dismissOnTap: true);

String? key = settingProvider.key;
bool isPrivate = settingProvider.isPrivateKey;
Expand All @@ -152,9 +152,9 @@ class AccountsState extends State<AccountsComponent> {
? Bip340EventSigner(isPrivate ? key : null, publicKey)
: Nip07EventSigner(await js.getPublicKeyAsync());

await initRelays(newKey: false);

followEventProvider.loadCachedFeed();
await followEventProvider.loadCachedFeed();
initRelays(newKey: false);
notificationsProvider.notifyListeners();
nwcProvider.init();
settingProvider.notifyListeners();
Expand Down
2 changes: 1 addition & 1 deletion lib/router/login/login_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ class _LoginRouter extends State<LoginRouter>
}

Future<void> initRelayManager( String publicKey, bool newKey) async {
EasyLoading.showToast("Relaying other stuff...", dismissOnTap: true, duration: const Duration(seconds: 5), maskType: EasyLoadingMaskType.black);
EasyLoading.showToast("Relaying other stuff...", dismissOnTap: true, duration: const Duration(seconds: 15), maskType: EasyLoadingMaskType.black);
await initRelays(newKey: newKey);
followEventProvider.loadCachedFeed();
nwcProvider.init();
Expand Down
6 changes: 3 additions & 3 deletions lib/router/relays/relays_item_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class RelaysItemComponent extends StatelessWidget {
bool finished = false;
Future.delayed(const Duration(seconds: 1), () {
if (!finished) {
EasyLoading.show(status: "Refreshing relay list before changing...", maskType: EasyLoadingMaskType.black);
EasyLoading.show(status: "Refreshing relay list before changing...", maskType: EasyLoadingMaskType.black, dismissOnTap: true);
}
});
await relayProvider.updateMarker(url, marker!);
Expand Down Expand Up @@ -243,7 +243,7 @@ class RelaysItemComponent extends StatelessWidget {
bool finished = false;
Future.delayed(const Duration(seconds: 1), () {
if (!finished) {
EasyLoading.show(status: "Refreshing relay list before changing...", maskType: EasyLoadingMaskType.black);
EasyLoading.show(status: "Refreshing relay list before changing...", maskType: EasyLoadingMaskType.black, dismissOnTap: true);
}
});
await relayProvider.updateMarker(url, marker!);
Expand Down Expand Up @@ -272,7 +272,7 @@ class RelaysItemComponent extends StatelessWidget {
bool finished = false;
Future.delayed(const Duration(seconds: 1), () {
if (!finished) {
EasyLoading.show(status: "Refreshing relay list before removing...", maskType: EasyLoadingMaskType.black);
EasyLoading.show(status: "Refreshing relay list before removing...", maskType: EasyLoadingMaskType.black, dismissOnTap: true);
}
});
await relayProvider.removeRelay(url);
Expand Down

0 comments on commit 0bdac6c

Please sign in to comment.