Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PE-4700: Release App v2.17.0 #1396

Merged
merged 33 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a1f74e8
disable multi-select when showing a modal
thiagocarvalhodev Sep 6, 2023
2752e38
feat(app shell): makes it not to show the wallet switch dialog when n…
matibat Sep 26, 2023
27b3503
chore(auth, login bloc, profile add cubit): removes unnecessary null …
matibat Sep 26, 2023
286f8ac
feat(ardrive auth): makes it be aware of the profile being logged out…
matibat Sep 26, 2023
0b3d6d5
feat(login bloc): removes unnecessary repeated code PE-4477
matibat Sep 26, 2023
76fe12a
feat(login): makes it not to notify the wallet mismatch when not usin…
matibat Sep 26, 2023
4319853
feat(login): awaits for unawaited promise PE-4477
matibat Sep 26, 2023
d3381a0
feat(app shel): reverts unnecessary change PE-4477
matibat Sep 26, 2023
75991d6
chore(app shell): variable typo PE-4477
matibat Sep 26, 2023
37dfde5
chore(user): removes unnecessary null check PE-4477
matibat Sep 26, 2023
26f5c0a
test(user utils): fixes unit test PE-4477
matibat Sep 26, 2023
543e2e4
test(ardrive auth test): fixes unit test PE-4477
matibat Sep 26, 2023
dd5d0e5
feat(topup dialog): makes the dropdown overlay match the with of the …
matibat Sep 27, 2023
bce579c
chore(cleanup): removes unused arguments PE-4397
matibat Sep 27, 2023
731ef3b
feat(deps): update the ArDrive UI dep PE-4397
matibat Sep 27, 2023
9cfad01
feat(topup modal): moves the country dropdown just below the credit c…
matibat Sep 27, 2023
632deb1
feat(app version widget): factors it out into its own source file PE-…
matibat Sep 27, 2023
3070914
feat(login page): adds the version on the bottom of the login page fo…
matibat Sep 27, 2023
3ced385
feat(share file): allow to share file when the file is pending
Sep 28, 2023
f9706fc
Merge branch 'dev' into disable-multi-select-when-showing-a-modal
thiagocarvalhodev Sep 28, 2023
0d025a0
feat(share file): fix lint warning
thiagocarvalhodev Sep 28, 2023
b48646f
chore(ardrive auth): corrects typo PE-4477
matibat Sep 28, 2023
791a442
feat(app version widget): makes the version component have the color …
matibat Sep 28, 2023
d2f279c
chore(app version widget): removes unnecessary log statements PE-4533
matibat Sep 28, 2023
e594ba8
Merge pull request #1393 from ardriveapp/PE-4544-lock-multi-select-wh…
thiagocarvalhodev Sep 28, 2023
42a98e6
Merge pull request #1391 from ardriveapp/PE-4533
matibat Sep 28, 2023
9f41b9b
Merge pull request #1392 from ardriveapp/PE-4081-allow-user-to-share-…
thiagocarvalhodev Sep 28, 2023
aa8e678
Merge pull request #1384 from ardriveapp/PE-4477
matibat Sep 28, 2023
8034723
feat(pubspec): bumps version of ardrive-io PE-4397
matibat Sep 28, 2023
ae143b7
bump version
thiagocarvalhodev Sep 28, 2023
cd2424c
Merge pull request #1388 from ardriveapp/PE-4397
matibat Sep 28, 2023
9248e9e
improve release notes
thiagocarvalhodev Sep 28, 2023
4ea4d54
Merge pull request #1395 from ardriveapp/PE-4700-release-ar-drive-app…
thiagocarvalhodev Sep 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions android/fastlane/metadata/android/en-US/changelogs/65.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- Add app version number on login page
- Disables multi-select option when a modal is open
- Pending files now can be shared
- Layout improvements to the country dropdown on the Turbo payment form
- Fixed issue where switching ArConnect wallets redirected users to initial unlock screen.
29 changes: 20 additions & 9 deletions lib/app_shell.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:ardrive/components/profile_card.dart';
import 'package:ardrive/components/side_bar.dart';
import 'package:ardrive/pages/drive_detail/components/hover_widget.dart';
import 'package:ardrive/utils/html/html_util.dart';
import 'package:ardrive/utils/logger/logger.dart';
import 'package:ardrive/utils/size_constants.dart';
import 'package:ardrive_ui/ardrive_ui.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -32,16 +33,26 @@ class AppShellState extends State<AppShell> {
bool _showWalletSwitchDialog = true;
@override
Widget build(BuildContext context) => BlocBuilder<DrivesCubit, DrivesState>(
builder: (context, state) {
builder: (context, _) {
onArConnectWalletSwitch(() {
if (_showWalletSwitchDialog) {
showDialog(
context: context,
builder: (context) => const WalletSwitchDialog(),
);
}
//Used to prevent the dialog being shown multiple times.
_showWalletSwitchDialog = false;
context
.read<ProfileCubit>()
.isCurrentProfileArConnect()
.then((isCurrentProfileArConnect) {
if (_showWalletSwitchDialog) {
if (isCurrentProfileArConnect) {
showDialog(
context: context,
builder: (context) => const WalletSwitchDialog(),
);
} else {
logger.d('Wallet switch detected while not logged in'
' to ArConnect. Ignoring.');
}
}
//Used to prevent the dialog being shown multiple times.
_showWalletSwitchDialog = false;
});
});

Widget buildPage(scaffold) => Material(
Expand Down
29 changes: 15 additions & 14 deletions lib/authentication/ardrive_auth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ abstract class ArDriveAuth {
Future<User> unlockWithBiometrics({required String localizedReason});
Future<User> unlockUser({required String password});
Future<void> logout();
User? get currentUser;
User get currentUser;
Stream<User?> onAuthStateChanged();
Future<bool> isBiometricsEnabled();

Expand Down Expand Up @@ -216,32 +216,33 @@ class ArDriveAuthImpl implements ArDriveAuth {

try {
if (_currentUser != null) {
if (currentUser.profileType == ProfileType.arConnect) {
try {
await _arConnectService.disconnect();
} catch (e) {
logger.e('Failed to disconnect from ArConnect', e);
}
}

_secureKeyValueStore.remove('password');
_secureKeyValueStore.remove('biometricEnabled');

await _secureKeyValueStore.remove('password');
await _secureKeyValueStore.remove('biometricEnabled');
currentUser = null;
firstPrivateDriveTxId = null;

await _disconnectFromArConnect();
_userStreamController.add(null);
}

await _databaseHelpers.deleteAllTables();

(await _metadataCache).clear();
} catch (e) {
logger.e('Failed to logout user', e);
throw AuthenticationFailedException('Failed to logout user');
}
}

Future<void> _disconnectFromArConnect() async {
final hasArConnectPermissions = await _arConnectService.checkPermissions();
if (hasArConnectPermissions) {
try {
await _arConnectService.disconnect();
} catch (e) {
logger.e('Failed to disconnect from ArConnect', e);
}
}
}

@override
Future<bool> isBiometricsEnabled() {
return _biometricAuthentication.isEnabled();
Expand Down
1 change: 1 addition & 0 deletions lib/authentication/components/biometric_toggle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class _BiometricToggleState extends State<BiometricToggle> {
} catch (e) {
widget.onError?.call();
if (e is BiometricException) {
// ignore: use_build_context_synchronously
showBiometricExceptionDialogForException(
context,
e,
Expand Down
58 changes: 41 additions & 17 deletions lib/authentication/login/blocs/login_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> {
}

Future<void> _handleUnlockUserWithBiometricsEvent(
UnLockWithBiometrics event, Emitter<LoginState> emit) async {
UnLockWithBiometrics event,
Emitter<LoginState> emit,
) async {
final previousState = state;

try {
Expand Down Expand Up @@ -107,7 +109,9 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> {
}

Future<void> _handleAddWalletFileEvent(
AddWalletFile event, Emitter<LoginState> emit) async {
AddWalletFile event,
Emitter<LoginState> emit,
) async {
final previousState = state;

try {
Expand All @@ -130,7 +134,9 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> {
}

Future<void> _handleLoginWithPasswordEvent(
LoginWithPassword event, Emitter<LoginState> emit) async {
LoginWithPassword event,
Emitter<LoginState> emit,
) async {
final previousState = state;

try {
Expand All @@ -150,7 +156,9 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> {
}

Future<void> _handleCheckIfUserIsLoggedInEvent(
CheckIfUserIsLoggedIn event, Emitter<LoginState> emit) async {
CheckIfUserIsLoggedIn event,
Emitter<LoginState> emit,
) async {
emit(LoginLoading());

if (await _arDriveAuth.isUserLoggedIn()) {
Expand All @@ -172,7 +180,9 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> {
}

Future<void> _handleUnlockUserWithPasswordEvent(
UnlockUserWithPassword event, Emitter<LoginState> emit) async {
UnlockUserWithPassword event,
Emitter<LoginState> emit,
) async {
final previousState = state;

emit(LoginLoading());
Expand All @@ -192,7 +202,9 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> {
}

Future<void> _handleCreatePasswordEvent(
CreatePassword event, Emitter<LoginState> emit) async {
CreatePassword event,
Emitter<LoginState> emit,
) async {
final previousState = state;

emit(LoginLoading());
Expand All @@ -212,7 +224,9 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> {
}

Future<void> _handleAddWalletFromArConnectEvent(
AddWalletFromArConnect event, Emitter<LoginState> emit) async {
AddWalletFromArConnect event,
Emitter<LoginState> emit,
) async {
final previousState = state;

try {
Expand Down Expand Up @@ -260,10 +274,6 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> {
await _arDriveAuth.logout();
}

if (_isArConnectWallet()) {
await _arConnectService.disconnect();
}

emit(LoginInitial(_arConnectService.isExtensionPresent()));
}

Expand Down Expand Up @@ -312,7 +322,13 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> {
return;
}

onArConnectWalletSwitch(() {
onArConnectWalletSwitch(() async {
final isUserLoggedIng = await _arDriveAuth.isUserLoggedIn();
if (isUserLoggedIng && !_isArConnectWallet()) {
logger.d('Wallet switch detected. Is current profile ArConnect: false');
return;
}

if (ignoreNextWaletSwitch) {
ignoreNextWaletSwitch = false;
return;
Expand All @@ -322,7 +338,7 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> {
// ignore: invalid_use_of_visible_for_testing_member
emit(const LoginFailure(WalletMismatchException()));

_arDriveAuth.logout();
await _arDriveAuth.logout();

// ignore: invalid_use_of_visible_for_testing_member
emit(const LoginInitial(true));
Expand All @@ -343,7 +359,9 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> {
}

Future<void> _handleEnterSeedPhrase(
EnterSeedPhrase event, Emitter<LoginState> emit) async {
EnterSeedPhrase event,
Emitter<LoginState> emit,
) async {
emit(LoginEnterSeedPhrase());
}

Expand All @@ -358,7 +376,9 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> {
}

Future<void> _handleAddWalletFromCompleterEvent(
AddWalletFromCompleter event, Emitter<LoginState> emit) async {
AddWalletFromCompleter event,
Emitter<LoginState> emit,
) async {
profileType = ProfileType.json;

Completer<Wallet> completer = event.walletCompleter;
Expand All @@ -380,14 +400,18 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> {
}

Future<void> _handleCreateNewWalletEvent(
CreateNewWallet event, Emitter<LoginState> emit) async {
CreateNewWallet event,
Emitter<LoginState> emit,
) async {
profileType = ProfileType.json;
final mnemonic = bip39.generateMnemonic();
emit(LoginCreateNewWallet(mnemonic));
}

Future<void> _handleCompleteWalletGenerationEvent(
CompleteWalletGeneration event, Emitter<LoginState> emit) async {
CompleteWalletGeneration event,
Emitter<LoginState> emit,
) async {
final previousState = state;
final wallet = event.wallet;

Expand Down
Loading
Loading