Skip to content

Commit

Permalink
add swap scheme (#1648)
Browse files Browse the repository at this point in the history
  • Loading branch information
boyan01 authored Aug 27, 2024
1 parent 8e54db7 commit e0427bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/constants/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ enum MixinSchemeHost {
snapshots,
conversations,
multisigs,
swap,
}

const int hour1 = 1000 * 60 * 60;
Expand Down
8 changes: 8 additions & 0 deletions lib/utils/uri_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ Future<bool> openUri(
return false;
}

if (uri.isSwap) {
await showUnknownMixinUrlDialog(context, uri);
return false;
}

if (uri.appId != null) {
if (uri.actionIsOpen) {
App? app;
Expand Down Expand Up @@ -347,6 +352,9 @@ extension _MixinUriExtension on Uri {

bool get isMultisigs => _isTypeHost(MixinSchemeHost.multisigs);

bool get isSwap =>
_isTypeHost(MixinSchemeHost.swap) || _isTypeScheme(MixinSchemeHost.swap);

String? get startTextOfConversation {
if (!isMixin) return null;
return queryParameters['start'];
Expand Down

0 comments on commit e0427bf

Please sign in to comment.