Skip to content

Commit

Permalink
Merge branch 'master' into comments_platform
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthak13gupta authored Oct 13, 2023
2 parents da194bd + ae0b78d commit a7b8b2c
Show file tree
Hide file tree
Showing 51 changed files with 1,101 additions and 962 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ android {
targetSdkVersion 33
multiDexEnabled true
versionCode 1
versionName "0.15-beta"
versionName "0.16.5-beta"
}

signingConfigs {
Expand Down
2 changes: 2 additions & 0 deletions android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<style name="LaunchTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:navigationBarColor">@color/breez_primary_color</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
</resources>
74 changes: 37 additions & 37 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -59,49 +59,49 @@ PODS:
- file_picker (0.0.1):
- DKImagePickerController/PhotoGallery
- Flutter
- Firebase/CoreOnly (10.12.0):
- FirebaseCore (= 10.12.0)
- Firebase/Database (10.12.0):
- Firebase/CoreOnly (10.15.0):
- FirebaseCore (= 10.15.0)
- Firebase/Database (10.15.0):
- Firebase/CoreOnly
- FirebaseDatabase (~> 10.12.0)
- Firebase/DynamicLinks (10.12.0):
- FirebaseDatabase (~> 10.15.0)
- Firebase/DynamicLinks (10.15.0):
- Firebase/CoreOnly
- FirebaseDynamicLinks (~> 10.12.0)
- Firebase/Messaging (10.12.0):
- FirebaseDynamicLinks (~> 10.15.0)
- Firebase/Messaging (10.15.0):
- Firebase/CoreOnly
- FirebaseMessaging (~> 10.12.0)
- firebase_core (2.15.1):
- Firebase/CoreOnly (= 10.12.0)
- FirebaseMessaging (~> 10.15.0)
- firebase_core (2.16.0):
- Firebase/CoreOnly (= 10.15.0)
- Flutter
- firebase_database (10.2.5):
- Firebase/Database (= 10.12.0)
- firebase_database (10.2.6):
- Firebase/Database (= 10.15.0)
- firebase_core
- Flutter
- firebase_dynamic_links (5.3.5):
- Firebase/DynamicLinks (= 10.12.0)
- firebase_dynamic_links (5.3.6):
- Firebase/DynamicLinks (= 10.15.0)
- firebase_core
- Flutter
- firebase_messaging (14.6.6):
- Firebase/Messaging (= 10.12.0)
- firebase_messaging (14.6.8):
- Firebase/Messaging (= 10.15.0)
- firebase_core
- Flutter
- FirebaseCore (10.12.0):
- FirebaseCore (10.15.0):
- FirebaseCoreInternal (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/Logger (~> 7.8)
- FirebaseCoreInternal (10.14.0):
- FirebaseCoreInternal (10.15.0):
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- FirebaseDatabase (10.12.0):
- FirebaseDatabase (10.15.0):
- FirebaseCore (~> 10.0)
- leveldb-library (~> 1.22)
- FirebaseDynamicLinks (10.12.0):
- FirebaseDynamicLinks (10.15.0):
- FirebaseCore (~> 10.0)
- FirebaseInstallations (10.14.0):
- FirebaseInstallations (10.15.0):
- FirebaseCore (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/UserDefaults (~> 7.8)
- PromisesObjC (~> 2.1)
- FirebaseMessaging (10.12.0):
- FirebaseMessaging (10.15.0):
- FirebaseCore (~> 10.0)
- FirebaseInstallations (~> 10.0)
- GoogleDataTransport (~> 9.2)
Expand Down Expand Up @@ -223,9 +223,9 @@ PODS:
- Flutter
- PromisesObjC (2.3.1)
- ReachabilitySwift (5.0.0)
- SDWebImage (5.17.0):
- SDWebImage/Core (= 5.17.0)
- SDWebImage/Core (5.17.0)
- SDWebImage (5.18.1):
- SDWebImage/Core (= 5.18.1)
- SDWebImage/Core (5.18.1)
- share_plus (0.0.1):
- Flutter
- shared_preferences_foundation (0.0.1):
Expand Down Expand Up @@ -404,17 +404,17 @@ SPEC CHECKSUMS:
ffmpeg-kit-ios-https-gpl: e43266620f2b601959b473be4a09ea190d7d9c40
ffmpeg_kit_flutter_https_gpl: 6434a09be0b21b6ee399e855935684f5e81cb5b7
file_picker: ce3938a0df3cc1ef404671531facef740d03f920
Firebase: 07150e75d142fb9399f6777fa56a187b17f833a0
firebase_core: 4a3246a02f828a01c74a2c26427037786d90f17f
firebase_database: ae8b70d7f5867c5f65a08353d81521896d850771
firebase_dynamic_links: cc3fd36190c7b58c27353915271d2c0d031ee11b
firebase_messaging: 13b378c8449cae7ec96c79570170943dd73d4738
FirebaseCore: f86a1394906b97ac445ae49c92552a9425831bed
FirebaseCoreInternal: d558159ee6cc4b823c2296ecc193de9f6d9a5bb3
FirebaseDatabase: 6d998d7ef2c1723b3e798a85e61a7dc0504b1ea0
FirebaseDynamicLinks: 1a387da899779e5ef34f4d6f8bdba882f90d0e67
FirebaseInstallations: f672b1eda64e6381c21d424a2f680a943fd83f3b
FirebaseMessaging: bb2c4f6422a753038fe137d90ae7c1af57251316
Firebase: 66043bd4579e5b73811f96829c694c7af8d67435
firebase_core: 77172d0a9d8d19d07606e24406e4c2fc14d3265b
firebase_database: 99bb3411da9863a065d38ef645bf160a2410762a
firebase_dynamic_links: 27625ac999a9353d6e323c07db85c3b55c5c6839
firebase_messaging: 6aff54d420b7ce7080c26dd131b08bc632666852
FirebaseCore: 2cec518b43635f96afe7ac3a9c513e47558abd2e
FirebaseCoreInternal: 2f4bee5ed00301b5e56da0849268797a2dd31fb4
FirebaseDatabase: f93f1481c7e9e3d77af960cdff82a408d37693e6
FirebaseDynamicLinks: 206d4ed3efd2b722822598017f3980d9fda89815
FirebaseInstallations: cae95cab0f965ce05b805189de1d4c70b11c76fb
FirebaseMessaging: 0c0ae1eb722ef0c07f7801e5ded8dccd1357d6d4
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_downloader: b7301ae057deadd4b1650dc7c05375f10ff12c39
flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069
Expand Down Expand Up @@ -449,7 +449,7 @@ SPEC CHECKSUMS:
printing: 233e1b73bd1f4a05615548e9b5a324c98588640b
PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
SDWebImage: 750adf017a315a280c60fde706ab1e552a3ae4e9
SDWebImage: ebdbcebc7933a45226d9313bd0118bc052ad458b
share_plus: 599aa54e4ea31d4b4c0e9c911bcc26c55e791028
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
Expand Down
2 changes: 1 addition & 1 deletion ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.15.11</string>
<string>0.16.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand Down
2 changes: 1 addition & 1 deletion lib/bloc/account/account_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class AccountBloc {
_accountController.add(AccountModel.initial());
_paymentsController.add(PaymentsModel.initial());
_paymentFilterController.add(PaymentFilterModel.initial());
_accountSettingsController.add(AccountSettings.start());
_accountSettingsController.add(AccountSettings.initial());

_start();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/bloc/account/account_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class AccountSettings {
this.isEscherEnabled = false,
});

AccountSettings.start() : this(false);
AccountSettings.initial() : this(false);

AccountSettings copyWith({
bool ignoreWalletBalance,
Expand Down
2 changes: 1 addition & 1 deletion lib/bloc/account/add_funds_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class AddFundsBloc extends Bloc {
});
});
_populateAvailableVendors();
_addFundsSettingsController.add(AddFundsSettings.start());
_addFundsSettingsController.add(AddFundsSettings.initial());
_handleAddFundsSettings(injector);
_handleMoonpayOrders(injector);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/bloc/account/add_funds_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class AddFundsSettings {

AddFundsSettings({this.moonpayIpCheck});

AddFundsSettings.start() : this(moonpayIpCheck: true);
AddFundsSettings.initial() : this(moonpayIpCheck: true);

AddFundsSettings copyWith({
bool moonpayIpCheck,
Expand Down
10 changes: 4 additions & 6 deletions lib/bloc/backup/backup_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class BackupBloc with AsyncActionsHandler {
_promptBackupDismissedController.sink;

final BehaviorSubject<BackupSettings> _backupSettingsController =
BehaviorSubject<BackupSettings>.seeded(BackupSettings.start());
BehaviorSubject<BackupSettings>.seeded(BackupSettings.initial());
Stream<BackupSettings> get backupSettingsStream =>
_backupSettingsController.stream;
Sink<BackupSettings> get backupSettingsSink => _backupSettingsController.sink;
Expand Down Expand Up @@ -240,7 +240,7 @@ class BackupBloc with AsyncActionsHandler {
//last backup time persistency
String backupStateJson =
_sharedPreferences.getString(LAST_BACKUP_STATE_PREFERENCE_KEY);
BackupState backupState = BackupState.start();
BackupState backupState = BackupState.initial();
if (backupStateJson != null) {
backupState = BackupState.fromJson(json.decode(backupStateJson));
}
Expand Down Expand Up @@ -538,7 +538,7 @@ class BackupBloc with AsyncActionsHandler {
},
);

backupServiceNeedLoginSink.add(true);
backupServiceNeedLoginSink.add(action.promptOnError);
action.resolve(null);
}

Expand Down Expand Up @@ -789,7 +789,6 @@ class BackupBloc with AsyncActionsHandler {
);
}
if (event.type == NotificationEvent_NotificationType.BACKUP_FAILED) {
backupServiceNeedLoginSink.add(true);
_backupStateController.addError(
BackupFailedException(
_backupSettingsController.value.backupProvider,
Expand All @@ -814,7 +813,6 @@ class BackupBloc with AsyncActionsHandler {
});
}
if (backupOperations.contains(event.type)) {
log.info("no backup provider set.");
_enableBackupPrompt = true;
_pushPromptIfNeeded();
}
Expand All @@ -823,7 +821,7 @@ class BackupBloc with AsyncActionsHandler {

void _pushPromptIfNeeded() {
log.info(
"push prompt if needed: {$_enableBackupPrompt, ${_backupServiceNeedLoginController.value}}",
"push prompt if needed: {_enableBackupPrompt: $_enableBackupPrompt, signInNeeded: ${_backupServiceNeedLoginController.value}}",
);
if (_enableBackupPrompt) {
_enableBackupPrompt = false;
Expand Down
19 changes: 12 additions & 7 deletions lib/bloc/backup/backup_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,13 @@ class BackupSettings {
this.remoteServerAuthData,
);

static BackupSettings start() => BackupSettings(
true,
BackupKeyType.NONE,
_defaultBackupProvider(),
const RemoteServerAuthData(null, null, null, null),
);
BackupSettings.initial()
: this(
true,
BackupKeyType.NONE,
_defaultBackupProvider(),
const RemoteServerAuthData(null, null, null, null),
);

BackupSettings copyWith({
bool promptOnError,
Expand Down Expand Up @@ -219,7 +220,7 @@ class BackupState {
this.lastBackupAccountName,
);

static BackupState start() => const BackupState(null, false, null);
BackupState.initial() : this(null, false, null);

BackupState copyWith({
DateTime lastBackupTime,
Expand Down Expand Up @@ -249,6 +250,8 @@ class BackupState {
"lastBackupAccountName": lastBackupAccountName
};
}

bool get isInitial => this != null && this == BackupState.initial();
}

class BackupFailedException implements Exception {
Expand Down Expand Up @@ -399,6 +402,7 @@ class BreezLibBackupKey {
entropy.length == ENTROPY_LENGTH ? 'Mnemonics12' : 'Mnemonics';
break;
case BackupKeyType.PIN:

/// Sets type of backups encrypted with PIN to
/// BackupKeyType.NONE as they are are non-secure & deprecated
result = '';
Expand All @@ -422,6 +426,7 @@ class BreezLibBackupKey {
switch (backupKeyType) {
case BackupKeyType.NONE:
case BackupKeyType.PIN:

/// Sets backup key type of backups encrypted with PIN to
/// BackupKeyType.NONE as they are are non-secure & deprecated
result = BreezLibBackupKey(entropy: null, key: null);
Expand Down
10 changes: 5 additions & 5 deletions lib/bloc/connect_pay/connect_pay_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ class PaymentSessionState {
: this(
true,
sessionSecret,
PayerSessionData(userName, imageURL, PeerStatus.start(), null, null),
PayeeSessionData(null, null, PeerStatus.start(), null, null, false),
PayerSessionData(userName, imageURL, PeerStatus.initial(), null, null),
PayeeSessionData(null, null, PeerStatus.initial(), null, null, false),
false,
false,
false,
Expand All @@ -66,9 +66,9 @@ class PaymentSessionState {
: this(
false,
sessionSecret,
PayerSessionData(null, null, PeerStatus.start(), null, null),
PayerSessionData(null, null, PeerStatus.initial(), null, null),
PayeeSessionData(
userName, imageURL, PeerStatus.start(), null, null, false),
userName, imageURL, PeerStatus.initial(), null, null, false),
true,
true,
false,
Expand Down Expand Up @@ -177,7 +177,7 @@ class PeerStatus {
final int lastChanged;

PeerStatus(this.online, this.lastChanged);
PeerStatus.start()
PeerStatus.initial()
: online = false,
lastChanged = 0;

Expand Down
2 changes: 1 addition & 1 deletion lib/bloc/connect_pay/payee_session.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class PayeeRemoteSession extends RemoteSession with OnlineStatusUpdater {
}
Map<String, dynamic> payerData = json.decode(sessionInfo.userInfo);
var persistedPayer = PayerSessionData.fromJson(payerData["payerData"])
.copyWith(status: PeerStatus.start());
.copyWith(status: PeerStatus.initial());
_paymentSessionController
.add(_currentSession.copyWith(payerData: persistedPayer));
}
Expand Down
2 changes: 1 addition & 1 deletion lib/bloc/connect_pay/payer_session.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class PayerRemoteSession extends RemoteSession with OnlineStatusUpdater {
}
var persistedPayee =
PayeeSessionData.fromJson(decodedSessionInfo["payeeData"])
.copyWith(status: PeerStatus.start());
.copyWith(status: PeerStatus.initial());
_paymentSessionController
.add(_currentSession.copyWith(payeeData: persistedPayee));
}
Expand Down
7 changes: 7 additions & 0 deletions lib/bloc/lnurl/lnurl_model.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:breez/bloc/user_profile/currency.dart';
import 'package:breez/services/breezlib/data/messages.pb.dart';
import 'package:fixnum/fixnum.dart';

Expand All @@ -10,6 +11,12 @@ class WithdrawFetchResponse {
Int64 get minAmount => response.minAmount;
Int64 get maxAmount => response.maxAmount;
bool get isFixedAmount => response.minAmount == response.maxAmount;

@override
String toString() {
return 'WithdrawFetchResponse{defaultDescription: $defaultDescription, '
'minAmount: $minAmount, maxAmount: $maxAmount, isFixedAmount: $isFixedAmount}';
}
}

class ChannelFetchResponse {
Expand Down
2 changes: 1 addition & 1 deletion lib/bloc/marketplace/marketplace_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class MarketplaceBloc {
}

_initNostrSettings() async {
_nostrSettingsController.add(NostrSettings.start());
_nostrSettingsController.add(NostrSettings.initial());
}

_listenNostrSettings() async {
Expand Down
2 changes: 1 addition & 1 deletion lib/bloc/marketplace/nostr_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class NostrSettings {

static const String NOSTR_SETTINGS_PREFERENCES_KEY = "nostr_settings";

NostrSettings.start()
NostrSettings.initial()
: this(
enableNostr: true,
isRememberPubKey: false,
Expand Down
5 changes: 5 additions & 0 deletions lib/bloc/user_profile/currency.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ class Currency extends Object {
}

double get satConversionRate => this == SAT ? 1.0 : 100000000;

@override
String toString() {
return 'Currency{tickerSymbol: $tickerSymbol}';
}
}

class _CurrencyFormatter {
Expand Down
Loading

0 comments on commit a7b8b2c

Please sign in to comment.