CAKE-356 | fixed _fetchEmojiFromUri method in the main.dart and fetchYatAddress method in the yat_record.dart

This commit is contained in:
OleksandrSobol 2021-09-17 11:14:17 +03:00
parent 2cf827d946
commit 7fd4772121
2 changed files with 7 additions and 2 deletions

View file

@ -228,11 +228,11 @@ class AppState extends State<App> with SingleTickerProviderStateMixin {
void _fetchEmojiFromUri(Uri uri, YatStore yatStore) { void _fetchEmojiFromUri(Uri uri, YatStore yatStore) {
final queryParameters = uri.queryParameters; final queryParameters = uri.queryParameters;
if (queryParameters == null || queryParameters.isEmpty) { if (queryParameters?.isEmpty ?? true) {
return; return;
} }
final emoji = queryParameters['eid']; final emoji = queryParameters['eid'];
if (emoji == null || emoji.isEmpty) { if (emoji?.isEmpty ?? true) {
return; return;
} }
yatStore.emoji = emoji; yatStore.emoji = emoji;

View file

@ -20,5 +20,10 @@ Future<String> fetchYatAddress(String emojiId, String ticker) async {
} }
final yatAddress = result.first['data'] as String; final yatAddress = result.first['data'] as String;
if (yatAddress?.isEmpty ?? true) {
return '';
}
return yatAddress; return yatAddress;
} }