Skip to content

Commit

Permalink
1.1.5 (#217)
Browse files Browse the repository at this point in the history
* fixme

* version bump

* upgrade dependencies

* fixme

* version bump

* upgrade dependencies

* fix logic bug when pushing to default wallet

* remove flickering
changelog

* fix animations for wallet list

* further dependency updates

* no longer persist labels from csv

* changelog

* replace rocket logo with peercoin logo

* fix scan problem with offline marisma
  • Loading branch information
willyfromtheblock authored Feb 23, 2023
1 parent 3baf00b commit 344a70e
Show file tree
Hide file tree
Showing 15 changed files with 164 additions and 165 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### **1.1.5** (2023-02-23)
* Fixed bug which would sometimes push to the wrong wallet after notification
* Address labels are no longer persistent for CSV file imports

### **1.1.4** (2023-02-11)
* Cease loading all wallets into cache on startup

Expand Down
Binary file added assets/icon/ppc-icon-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/img/setup-launch.png
Binary file not shown.
4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import 'models/wallet_utxo.dart';
import 'providers/active_wallets.dart';
import 'providers/electrum_connection.dart';
import 'providers/encrypted_box.dart';
import 'screens/setup/setup.dart';
import 'screens/setup/setup_landing.dart';
import 'screens/wallet/wallet_list.dart';
import 'tools/app_localizations.dart';
import 'tools/app_routes.dart';
Expand Down Expand Up @@ -113,7 +113,7 @@ void main() async {
//check web session expired

if (setupFinished == false || sessionExpired == true) {
_homeWidget = const SetupScreen();
_homeWidget = const SetupLandingScreen();
} else if (failedAuths > 0) {
_homeWidget = const AuthJailScreen(
jailedFromHome: true,
Expand Down
7 changes: 4 additions & 3 deletions lib/screens/setup/setup_auth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import '../../tools/app_localizations.dart';
import '../../tools/app_routes.dart';
import '../../widgets/buttons.dart';
import '../../widgets/setup/session_slider.dart';
import 'setup.dart';
import 'setup_landing.dart';

class SetupAuthScreen extends StatefulWidget {
const SetupAuthScreen({Key? key}) : super(key: key);
Expand Down Expand Up @@ -54,7 +54,7 @@ class _SetupAuthScreenState extends State<SetupAuthScreen> {
),
body: SingleChildScrollView(
child: Container(
height: SetupScreen.calcContainerHeight(context),
height: SetupLandingScreen.calcContainerHeight(context),
color: Theme.of(context).primaryColor,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
Expand Down Expand Up @@ -115,7 +115,8 @@ class _SetupAuthScreenState extends State<SetupAuthScreen> {
),
),
value: _biometricsAllowed,
activeColor: Theme.of(context).colorScheme.background,
activeColor:
Theme.of(context).colorScheme.background,
inactiveThumbColor: Colors.grey,
onChanged: (newState) {
if (_biometricsAvailable == false) {
Expand Down
7 changes: 4 additions & 3 deletions lib/screens/setup/setup_create_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import '../../tools/app_routes.dart';
import '../../tools/share_wrapper.dart';
import '../../widgets/buttons.dart';
import '../../widgets/loading_indicator.dart';
import 'setup.dart';
import 'setup_landing.dart';
import '../../widgets/logout_dialog_dummy.dart'
if (dart.library.html) '../../widgets/logout_dialog.dart';

Expand Down Expand Up @@ -174,7 +174,7 @@ class _SetupCreateWalletScreenState extends State<SetupCreateWalletScreen> {
),
body: SingleChildScrollView(
child: Container(
height: SetupScreen.calcContainerHeight(context),
height: SetupLandingScreen.calcContainerHeight(context),
color: Theme.of(context).primaryColor,
child: _isLoading
? const Center(
Expand Down Expand Up @@ -305,7 +305,8 @@ class _SetupCreateWalletScreenState extends State<SetupCreateWalletScreen> {
Radius.circular(20),
),
color: Theme.of(context)
.colorScheme.background,
.colorScheme
.background,
border: Border.all(
width: 2,
color: _sharedYet
Expand Down
4 changes: 2 additions & 2 deletions lib/screens/setup/setup_data_feeds.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import '../../providers/app_settings.dart';
import '../../tools/app_localizations.dart';
import '../../tools/app_routes.dart';
import '../../widgets/buttons.dart';
import 'setup.dart';
import 'setup_landing.dart';

class SetupDataFeedsScreen extends StatefulWidget {
const SetupDataFeedsScreen({Key? key}) : super(key: key);
Expand Down Expand Up @@ -69,7 +69,7 @@ class _SetupDataFeedsScreenState extends State<SetupDataFeedsScreen> {
),
body: SingleChildScrollView(
child: Container(
height: SetupScreen.calcContainerHeight(context),
height: SetupLandingScreen.calcContainerHeight(context),
color: Theme.of(context).primaryColor,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
Expand Down
12 changes: 7 additions & 5 deletions lib/screens/setup/setup_import_seed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import '../../tools/app_localizations.dart';
import '../../tools/app_routes.dart';
import '../../tools/logger_wrapper.dart';
import '../../widgets/buttons.dart';
import 'setup.dart';
import 'setup_landing.dart';

class SetupImportSeedScreen extends StatefulWidget {
const SetupImportSeedScreen({Key? key}) : super(key: key);
Expand Down Expand Up @@ -83,7 +83,7 @@ class _SetupImportSeedState extends State<SetupImportSeedScreen> {
),
body: SingleChildScrollView(
child: Container(
height: SetupScreen.calcContainerHeight(context),
height: SetupLandingScreen.calcContainerHeight(context),
color: Theme.of(context).primaryColor,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
Expand Down Expand Up @@ -219,8 +219,9 @@ class _SetupImportSeedState extends State<SetupImportSeedScreen> {
fontSize: 16,
),
filled: true,
fillColor:
Theme.of(context).colorScheme.background,
fillColor: Theme.of(context)
.colorScheme
.background,
suffixIcon: IconButton(
onPressed: () async {
final focusScope =
Expand All @@ -244,7 +245,8 @@ class _SetupImportSeedState extends State<SetupImportSeedScreen> {
focusedBorder: border,
enabledBorder: border,
errorStyle: TextStyle(
color: Theme.of(context).colorScheme.error,
color:
Theme.of(context).colorScheme.error,
),
errorBorder: border,
focusedErrorBorder: border,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import '../../tools/app_routes.dart';
import '../../widgets/buttons.dart';
import '../../widgets/setup_progress.dart';

class SetupScreen extends StatefulWidget {
const SetupScreen({Key? key}) : super(key: key);
class SetupLandingScreen extends StatefulWidget {
const SetupLandingScreen({Key? key}) : super(key: key);

@override
State<SetupScreen> createState() => _SetupScreenState();
State<SetupLandingScreen> createState() => _SetupLandingScreenState();

static double calcContainerHeight(BuildContext ctx) {
var height = MediaQuery.of(ctx).size.height;
Expand All @@ -27,7 +27,7 @@ class SetupScreen extends StatefulWidget {
}
}

class _SetupScreenState extends State<SetupScreen> {
class _SetupLandingScreenState extends State<SetupLandingScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
Expand All @@ -38,7 +38,7 @@ class _SetupScreenState extends State<SetupScreen> {
),
body: SingleChildScrollView(
child: Container(
height: SetupScreen.calcContainerHeight(context),
height: SetupLandingScreen.calcContainerHeight(context),
color: Theme.of(context).primaryColor,
child: Stack(
fit: StackFit.expand,
Expand All @@ -57,7 +57,7 @@ class _SetupScreenState extends State<SetupScreen> {
height: MediaQuery.of(context).size.height / 20,
),
Image.asset(
'assets/img/setup-launch.png',
'assets/icon/ppc-icon-white.png',
height: MediaQuery.of(context).size.height / 5,
),
Column(
Expand Down
4 changes: 2 additions & 2 deletions lib/screens/setup/setup_legal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:url_launcher/url_launcher_string.dart';
import '../../tools/app_localizations.dart';
import '../../tools/app_routes.dart';
import '../../widgets/buttons.dart';
import 'setup.dart';
import 'setup_landing.dart';

class SetupLegalScreen extends StatefulWidget {
const SetupLegalScreen({Key? key}) : super(key: key);
Expand Down Expand Up @@ -34,7 +34,7 @@ class _SetupLegalScreenState extends State<SetupLegalScreen> {

double calcHeight(BuildContext context) {
if (MediaQuery.of(context).size.width < 500) return 900;
return SetupScreen.calcContainerHeight(context);
return SetupLandingScreen.calcContainerHeight(context);
}

@override
Expand Down
37 changes: 14 additions & 23 deletions lib/screens/wallet/wallet_list.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: use_build_context_synchronously

import 'dart:async';
import 'dart:io';

Expand All @@ -19,7 +21,7 @@ import '../../tools/background_sync.dart';
import '../../tools/periodic_reminders.dart';
import '../../tools/price_ticker.dart';
import '../../tools/share_wrapper.dart';
import '../../widgets/loading_indicator.dart';
import '../../widgets/spinning_peercoin_icon.dart';
import '../../widgets/wallet/new_wallet.dart';
import '../../tools/session_checker.dart';
import '../../widgets/buttons.dart';
Expand All @@ -42,15 +44,14 @@ class WalletListScreen extends StatefulWidget {

class _WalletListScreenState extends State<WalletListScreen>
with SingleTickerProviderStateMixin {
bool _isLoading = false;
bool _initial = true;
late ActiveWallets _activeWallets;
late Animation<double> _animation;
late AnimationController _controller;
late Timer _priceTimer;
late Timer _sessionTimer;
late AppSettings _appSettings;
late List _activeWalletValues;
late List<CoinWallet> _activeWalletValues;

@override
void initState() {
Expand Down Expand Up @@ -118,7 +119,6 @@ class _WalletListScreenState extends State<WalletListScreen>
const Duration(minutes: 10),
(timer) async {
if (await checkSessionExpired()) {
// ignore: use_build_context_synchronously
Navigator.of(context).pop();
LogoutDialog.reloadWindow();
}
Expand All @@ -134,7 +134,6 @@ class _WalletListScreenState extends State<WalletListScreen>
}
if (widget.fromColdStart == true &&
_appSettings.authenticationOptions!['walletList']!) {
// ignore: use_build_context_synchronously
await Auth.requireAuth(
context: context,
biometricsAllowed: _appSettings.biometricsAllowed,
Expand All @@ -161,36 +160,28 @@ class _WalletListScreenState extends State<WalletListScreen>
);
}
//push to default wallet
if (_activeWalletValues.length == 1) {
//only one wallet available, pushing to that one
setState(() {
_isLoading = true;
});
if (_activeWalletValues.length == 1 &&
widget.walletToOpenDirectly.isEmpty) {
//only one wallet available, pushing to that one (no walletToOpenDirectly set)
if (!kIsWeb) {
context.loaderOverlay.show();
await navigator.pushNamed(
Routes.walletHome,
arguments: {
'wallet': _activeWalletValues[0],
'wallet': _activeWalletValues.first,
},
);
}
setState(() {
_isLoading = false;
});
} else if (_activeWalletValues.length > 1) {
} else if (_activeWalletValues.length > 1 ||
widget.walletToOpenDirectly.isNotEmpty) {
if (defaultWallet != null) {
setState(() {
_isLoading = true;
});
context.loaderOverlay.show();
if (!kIsWeb) {
await navigator.pushNamed(
Routes.walletHome,
arguments: {'wallet': defaultWallet},
);
}
setState(() {
_isLoading = false;
});
}
}
}
Expand Down Expand Up @@ -254,9 +245,9 @@ class _WalletListScreenState extends State<WalletListScreen>
)
],
),
body: _isLoading || _initial
body: _initial
? const Center(
child: LoadingIndicator(),
child: SpinningPeercoinIcon(),
)
: Container(
width: double.infinity,
Expand Down
7 changes: 7 additions & 0 deletions lib/tools/background_sync.dart
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,13 @@ class BackgroundSync {

Map<String, int> answerMap = {};

try {
await grpcClient.getBlockHeight(BlockHeightRequest());
} catch (e) {
//client not available
return answerMap;
}

await Future.forEach(
addressesToQuery.keys,
(String addr) async {
Expand Down
9 changes: 1 addition & 8 deletions lib/widgets/wallet/send_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -760,11 +760,6 @@ class _SendTabState extends State<SendTab> {
),
);

//temporarily disable persisting labels for more than 100 addresses on web
if (kIsWeb && buildResult.recipients.length > 100) {
return;
} //TODO fix underlying performance issue with Hive on web that makes this necessary

//persist labels
_labelControllerList.asMap().forEach(
(index, controller) {
Expand Down Expand Up @@ -801,17 +796,15 @@ class _SendTabState extends State<SendTab> {
final amount = double.parse(
row[1].replaceAll(',', '.'),
);
final label = row.length == 3 ? row[2] : '';
if (i == 0) {
_addressControllerList[0].text = address;
_labelControllerList[0].text = label;
_amountControllerList[0].text = amount.toString();
_requestedAmountInCoinsList[0] = amount;
} else {
_addNewAddress(
address: address,
amount: amount,
label: label,
label: '',
fromImport: true,
);
setState(() {
Expand Down
Loading

0 comments on commit 344a70e

Please sign in to comment.