Skip to content

Commit

Permalink
Merge pull request #23 from jagerman/fixes
Browse files Browse the repository at this point in the history
Fixes for 1.0.9
  • Loading branch information
jagerman authored Apr 22, 2022
2 parents fbe127e + 9e0b42b commit 14291fa
Show file tree
Hide file tree
Showing 38 changed files with 388 additions and 257 deletions.
38 changes: 37 additions & 1 deletion assets/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,43 @@
-
version: 1.0.9
changes:
- Fix crash at startup experienced by some users.
- Fall back to english transaction if local language not found
- Re-add language override setting that was disabled in 1.0.8
- French wording fix on seed word input error message
- Add fees and stake amounts to transactions list and info pages
- Fixed some errors not properly showing an error message
- Fixed scrolling on Stakes page
- Added staked OXEN amount and current SN status indicators to stake page

-
version: 1.0.8
changes:
- Show warning screen before deleting a wallet.
- Updated entire codebase to modern "null safe" dart.
- Updated all dependencies to newer versions (which required the above changes)
- Fixed a bug in PIN setup that didn't properly check the two pins were the same (and always used the second one).
- Various translation fixes and wording updates.
- Use more appropriate locale-specific date displays.
- Fixes several small memory leaks.
- Stylized the "receive" QR code with an embedded Oxen logo and Oxen colouring.
- Added QR code scanning to the New Stake page (to allow scanning QR code pubkeys from awaiting contribution nodes on https://oxen.observer/).
- Made the multi-option settings on the Settings page default to current value instead of resetting to the first value when tapped.
- Removed character restrictions from wallet, account, subaccount, and address book names.
- Service Nodes stakes now properly lists only the wallet's actual stakes for staked service node rather than everyone's stakes in the service node.
- Label staking transactions as "Stake" rather than "Sent"
- Don't show fiat input on the send page if fiat lookups not enabled
- Show which words are wrong in the seed input widget, and make it editable.

-
version: 1.0.7
changes:
- Various crash fixes while syncing

-
version: 1.0.6
changes:
- Fix crash while syncing
- Fix crash while fetching balance
-
version: 1.0.5
changes:
Expand Down
3 changes: 0 additions & 3 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
Expand Down
27 changes: 27 additions & 0 deletions lib/l10n.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,30 @@ export 'package:flutter_gen/gen_l10n/app_localizations.dart' show AppLocalizatio
AppLocalizations tr(BuildContext ctx) {
return AppLocalizations.of(ctx) ?? lookupAppLocalizations(Locale('en', ''));
}

class LanguageName {
final String code;
final String name;
const LanguageName(this.code, this.name);
}

const languageNames = <LanguageName>[
LanguageName('en', 'English'),
LanguageName('de', 'Deutsch (German)'),
LanguageName('fr', 'Français (French)'),
// LanguageName('es', 'Español (Spanish)'),
// LanguageName('hi', 'हिंदी (Hindi)'),
// LanguageName('ja', '日本 (Japanese)'),
// LanguageName('ko', '한국어 (Korean)'),
// LanguageName('nl', 'Nederlands (Dutch)'),
// LanguageName('pl', 'Polski (Polish)'),
// LanguageName('pt', 'Português (Portuguese)'),
// LanguageName('ru', 'Русский (Russian)'),
// LanguageName('uk', 'Українська (Ukrainian)'),
// LanguageName('zh', '中文 (Chinese)')
];

class LanguageNotifier with ChangeNotifier {
LanguageNotifier();
void trigger() { notifyListeners(); }
}
7 changes: 5 additions & 2 deletions lib/l10n/app_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
"yesterday" : "Gestern",
"received" : "Empfangen",
"sent" : "Geschickt",
"amount" : "Menge: {amount}",
"fee": "Gebühr: {fee}",
"stake" : "Stake",
"pending" : " (steht aus)",
"rescan" : "Erneut scannen",
Expand All @@ -70,12 +72,10 @@
"copied_to_clipboard" : "In die Zwischenablage kopiert",
"fetching" : "aktualisieren",
"id" : "ID: ",
"amount" : "Menge: ",
"status" : "Status: ",
"confirm" : "Bestätigen",
"confirm_sending" : "Bestätigen Sie das Senden",
"confirm_stake" : "Bestätigen Sie der Stake",
"confirm_transaction_amount_fee" : "Menge: {amount} OXEN\nGebühr: {fee} OXEN",
"sending" : "Senden",
"transaction_sent" : "Transaktion gesendet!",
"send_oxen" : "OXEN Senden",
Expand Down Expand Up @@ -234,6 +234,8 @@
"transaction_details_date" : "Datum",
"transaction_details_height" : "Höhe",
"transaction_details_amount" : "Betrag",
"transaction_details_fee" : "Gebühr",
"transaction_details_stake" : "Stake",
"transaction_details_copied" : "{title} in die Zwischenablage kopiert",
"transaction_details_recipient_address" : "Empfängeradresse",

Expand Down Expand Up @@ -295,6 +297,7 @@

"change_language" : "Sprache ändern",
"change_language_to" : "Ändern Sie die Sprache zu {language}?",
"change_language_system_default" : "Systemvoreinstellung",

"paste" : "Einfügen",
"restore_from_seed_placeholder" : "Bitte geben Sie hier Ihren Code ein",
Expand Down
10 changes: 7 additions & 3 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
"yesterday" : "Yesterday",
"received" : "Received",
"sent" : "Sent",
"amount" : "Amount: {amount}",
"@amount" : { "placeholders": { "amount": {} } },
"fee" : "Fee: {fee}",
"@fee" : { "placeholders": { "fee": {} } },
"stake" : "Stake",
"pending" : " (pending)",
"rescan" : "Rescan",
Expand All @@ -68,13 +72,10 @@
"copied_to_clipboard" : "Copied to Clipboard",
"fetching" : "Fetching",
"id" : "ID: ",
"amount" : "Amount: ",
"status" : "Status: ",
"confirm" : "Confirm",
"confirm_sending" : "Confirm sending",
"confirm_stake" : "Confirm stake",
"confirm_transaction_amount_fee" : "Amount: {amount}\nFee: {fee}",
"@confirm_transaction_amount_fee" : { "placeholders": { "amount": {}, "fee": {} } },
"sending" : "Sending",
"transaction_sent" : "Transaction sent!",
"send_oxen" : "Send OXEN",
Expand Down Expand Up @@ -242,6 +243,8 @@
"transaction_details_date" : "Date",
"transaction_details_height" : "Height",
"transaction_details_amount" : "Amount",
"transaction_details_fee" : "Fee",
"transaction_details_stake" : "Stake",
"transaction_details_copied" : "{title} copied to Clipboard",
"@transaction_details_copied" : { "placeholders": { "title": {} }},
"transaction_details_recipient_address" : "Recipient address",
Expand Down Expand Up @@ -312,6 +315,7 @@
"change_language" : "Change language",
"change_language_to" : "Change language to {language}?",
"@change_language_to" : { "placeholders": { "language": {} }},
"change_language_system_default" : "System default",

"paste" : "Paste",
"restore_from_seed_placeholder" : "Please enter or paste your seed here",
Expand Down
9 changes: 6 additions & 3 deletions lib/l10n/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
"yesterday" : "hier",
"received" : "a reçu",
"sent" : "expédié",
"amount": "Montant: {amount}",
"fee": "Fee: {fee}",
"stake" : "Stake",
"pending" : " (en attente)",
"rescan" : "réanalyser",
Expand All @@ -66,12 +68,10 @@
"copied_to_clipboard" : "Copié dans le presse-papiers",
"fetching" : "Récupération",
"id" : "ID: ",
"amount" : "Montant: ",
"status" : "Statut: ",
"confirm" : "confirmer",
"confirm_sending" : "Confirmer l'envoi",
"confirm_stake" : "Confirmer le Stake",
"confirm_transaction_amount_fee" : "Montant: {amount} OXEN\nFee: {fee} OXEN",
"sending" : "Envoyer",
"transaction_sent" : "Transaction envoyé!",
"send_oxen" : "Envoyer OXEN",
Expand Down Expand Up @@ -234,6 +234,8 @@
"transaction_details_date" : "Date",
"transaction_details_height" : "Taille",
"transaction_details_amount" : "Montant",
"transaction_details_fee" : "Fee",
"transaction_details_stake" : "Stake",
"transaction_details_copied" : "{title} copié dans le presse-papiers",
"transaction_details_recipient_address" : "Adresse du destinataire",

Expand Down Expand Up @@ -296,12 +298,13 @@

"change_language" : "changer la langue",
"change_language_to" : "Changez la langue en {language}?",
"change_language_system_default" : "préréglage du système",

"paste" : "Coller",
"restore_from_seed_placeholder" : "Veuillez entrer votre code ici",
"add_new_word" : "Ajouter un nouveau mot",
"incorrect_seed" : "Le texte saisi n'est pas valide.",
"invalid_seed_words": "\nMots invalide: {words}.",
"invalid_seed_words": "\nMots invalides: {words}.",

"biometric_auth_reason" : "Scannez votre empreinte digitale pour l'authentification",
"version" : "Version {currentVersion}",
Expand Down
24 changes: 20 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import 'package:oxen_wallet/src/domain/common/default_settings_migration.dart';
import 'package:oxen_wallet/src/domain/common/fiat_currency.dart';
import 'package:oxen_wallet/src/wallet/wallet_type.dart';
import 'package:oxen_wallet/src/domain/services/wallet_service.dart';
import 'package:oxen_wallet/l10n.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:oxen_wallet/src/stores/seed_language/seed_language_store.dart';

Expand Down Expand Up @@ -160,10 +161,13 @@ class OxenWalletApp extends StatelessWidget {
Widget build(BuildContext context) {
final settingsStore = Provider.of<SettingsStore>(context);

return ChangeNotifierProvider<ThemeChanger>(
create: (_) => ThemeChanger(
settingsStore.isDarkTheme ? Themes.darkTheme : Themes.lightTheme),
child: MaterialAppWithTheme());
return ChangeNotifierProvider(
create: (_) => ThemeChanger(settingsStore.isDarkTheme ? Themes.darkTheme : Themes.lightTheme),
builder: (context, child) => ChangeNotifierProvider(
create: (_) => LanguageNotifier(),
builder: (context, child) => MaterialAppWithTheme(),
)
);
}
}

Expand All @@ -182,6 +186,7 @@ class MaterialAppWithTheme extends StatelessWidget {
final theme = Provider.of<ThemeChanger>(context);
final statusBarColor =
settingsStore.isDarkTheme ? Colors.black : Colors.white;
final languageNotifier = Provider.of<LanguageNotifier>(context);
final contacts = Provider.of<Box<Contact>>(context);
final nodes = Provider.of<Box<Node>>(context);
final transactionDescriptions =
Expand All @@ -193,6 +198,17 @@ class MaterialAppWithTheme extends StatelessWidget {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: theme.getTheme(),
localeListResolutionCallback: (List<Locale>? userLocales, Iterable<Locale> supported) {
for (var userLocale in userLocales ?? <Locale>[]) {
for (var locale in supported) {
if (locale.languageCode == userLocale.languageCode &&
(locale.countryCode == null || locale.countryCode! == userLocale.countryCode))
return userLocale;
}
}
return Locale('en');
},
locale: settingsStore.languageOverride != null ? Locale(settingsStore.languageOverride!) : null,
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
onGenerateRoute: (settings) => oxenroute.Router.generateRoute(
Expand Down
4 changes: 4 additions & 0 deletions lib/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import 'package:oxen_wallet/src/screens/seed/create_seed_page.dart';
import 'package:oxen_wallet/src/screens/seed_language/seed_language_page.dart';
import 'package:oxen_wallet/src/screens/send/send_page.dart';
import 'package:oxen_wallet/src/screens/settings/settings.dart';
import 'package:oxen_wallet/src/screens/settings/change_language.dart';
import 'package:oxen_wallet/src/screens/setup_pin_code/setup_pin_code.dart';
import 'package:oxen_wallet/src/screens/show_keys/show_keys_page.dart';
import 'package:oxen_wallet/src/screens/stake/new_stake_page.dart';
Expand Down Expand Up @@ -431,6 +432,9 @@ class Router {
case Routes.changelog:
return MaterialPageRoute<void>(builder: (_) => ChangelogPage());

case Routes.changeLanguage:
return MaterialPageRoute<void>(builder: (_) => ChangeLanguage());

case Routes.profile:
return MaterialPageRoute<void>(builder: (_) => ProfilePage());

Expand Down
2 changes: 1 addition & 1 deletion lib/src/domain/common/calculate_fiat_amount.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:oxen_wallet/src/wallet/oxen/oxen_amount_format.dart';
String calculateFiatAmount({required double price, required int cryptoAmount}) {
if (price.isNaN || price <= 0.0 || cryptoAmount <= 0)
return '0.00';
final result = price * oxenAmountToDouble(cryptoAmount);
final result = price * cryptoAmount / OXEN_DIVISOR;

if (result == 0.0) {
return '0.00';
Expand Down
62 changes: 0 additions & 62 deletions lib/src/domain/common/openalias_record.dart

This file was deleted.

2 changes: 1 addition & 1 deletion lib/src/domain/services/wallet_list_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class WalletIsExistException implements Exception {
String name;

@override
String toString() => 'Wallet with name $name is already exist!';
String toString() => 'Wallet with name $name already exists!';
}

class WalletListService {
Expand Down
16 changes: 7 additions & 9 deletions lib/src/screens/changelog/changelog_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class ChangelogPage extends BasePage {
Widget body(BuildContext context) {
return FutureBuilder(
builder: (context, snapshot) {
if (!snapshot.hasData)
return Container();
final changelogs = loadYaml(snapshot.data.toString()) as YamlList;

return ListView.separated(
Expand All @@ -27,15 +29,11 @@ class ChangelogPage extends BasePage {
return ExpansionTile(
title: Text(versionTitle),
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Expanded(
child: Container(
padding: EdgeInsets.only(left: 15.0, right: 15.0),
child: Text('$versionChangesText\n')))
],
)
for (var e in versionChanges)
ListTile(
leading: Icon(Icons.arrow_right),
title: new Text(e),
)
],
);
},
Expand Down
Loading

0 comments on commit 14291fa

Please sign in to comment.