Skip to content

Commit

Permalink
fix: refresh WalletConnectSessionsBloc
Browse files Browse the repository at this point in the history
  • Loading branch information
alienc0der committed Jul 19, 2023
1 parent 006bd7b commit fbf7fe5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
12 changes: 7 additions & 5 deletions lib/services/wallet_connect_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ class WalletConnectService {
name: 's y r i u s',
description: 'A wallet for interacting with Zenon Network',
url: 'https://zenon.network',
// TODO: add Zenon icon
icons: ['https://avatars.githubusercontent.com/u/37784886'],
icons: [
'https://raw.githubusercontent.com/zenon-network/syrius/master/macos/Runner/Assets.xcassets/AppIcon.appiconset/Icon-MacOS-512x512%402x.png'
],
),
).onError((e, stackTrace) {
Logger('WalletConnectService')
Expand Down Expand Up @@ -80,6 +81,8 @@ class WalletConnectService {
Future<PairingInfo> pair(Uri uri) => _wcClient.pair(uri: uri);

void _initListeners() {
_wcClient.onSessionProposal.subscribe(onSessionProposal);

_wcClient.core.relayClient.onRelayClientDisconnect.subscribe((args) {
Logger('WalletConnectService').log(
Level.INFO, 'onRelayClientDisconnect triggered', args.toString());
Expand Down Expand Up @@ -137,11 +140,10 @@ class WalletConnectService {
_wcClient.onSessionConnect.subscribe((args) {
Logger('WalletConnectService')
.log(Level.INFO, 'onSessionConnect triggered', args.toString());
sl.get<WalletConnectSessionsBloc>().refreshResults();
Future.delayed(const Duration(seconds: 3)).then(
(value) => sl.get<WalletConnectSessionsBloc>().refreshResults());
});

_wcClient.onSessionProposal.subscribe(onSessionProposal);

_wcClient.onSessionRequest.subscribe((SessionRequestEvent? request) async {
Logger('WalletConnectService')
.log(Level.INFO, 'onSessionRequest triggered', request.toString());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import 'package:flutter/material.dart';
import 'package:layout/layout.dart';
import 'package:zenon_syrius_wallet_flutter/widgets/modular_widgets/wallet_connect_widgets/wallet_connect_camera_card.dart';
import 'package:zenon_syrius_wallet_flutter/widgets/modular_widgets/wallet_connect_widgets/wallet_connect_pairing_list_card.dart';
import 'package:zenon_syrius_wallet_flutter/widgets/modular_widgets/wallet_connect_widgets/wallet_connect_qr_card.dart';
import 'package:zenon_syrius_wallet_flutter/widgets/modular_widgets/wallet_connect_widgets/wallet_connect_uri_card.dart';
import 'package:zenon_syrius_wallet_flutter/widgets/modular_widgets/wallet_connect_widgets/wallet_connect_session_list_card.dart';
import 'package:zenon_syrius_wallet_flutter/widgets/widgets.dart';

class WalletConnectTabChild extends StatelessWidget {
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1513,10 +1513,10 @@ packages:
dependency: "direct main"
description:
name: walletconnect_flutter_v2
sha256: "3c640498e83405a21d27bc180178e32f69eaedcf94e4dd6511bd274c94903353"
sha256: "87295fb305767bb089e6c5a78f273b52e30ade6eaa5fa89c3e103970f0ce6721"
url: "https://pub.dev"
source: hosted
version: "2.0.13"
version: "2.0.14"
watcher:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ dependencies:
launch_at_startup: ^0.2.1
app_links: ^3.4.3
logging: ^1.2.0
walletconnect_flutter_v2: ^2.0.13
walletconnect_flutter_v2: ^2.0.14
preference_list: ^0.0.1
screen_capturer: ^0.1.2
uni_ocr: ^0.1.0
Expand Down

0 comments on commit fbf7fe5

Please sign in to comment.