From 96bfd70eaa5779a53e395d3fcd0280a60267a14f Mon Sep 17 00:00:00 2001 From: vauvenal5 Date: Tue, 12 Jan 2021 14:06:16 +0100 Subject: [PATCH] fix login being navigated to wrong page --- .../android/en-US/changelogs/1705.txt | 7 ++ lib/views/screens/nc_login_screen.dart | 72 +++++++++---------- pubspec.yaml | 2 +- 3 files changed, 44 insertions(+), 37 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/1705.txt diff --git a/fastlane/metadata/android/en-US/changelogs/1705.txt b/fastlane/metadata/android/en-US/changelogs/1705.txt new file mode 100644 index 0000000..8e177bd --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/1705.txt @@ -0,0 +1,7 @@ +- introducing multi-select +- allow sharing of multiple images +- fix ripple effect on image tiles +- fix NC behinde subpath issue +- fix fixedOrigin propagation for root mapping +- replace button bar with bottom nav to align style and fix reder issue +- fix issue of app not being properly navigated to grant access site \ No newline at end of file diff --git a/lib/views/screens/nc_login_screen.dart b/lib/views/screens/nc_login_screen.dart index af46fe3..0e9591f 100644 --- a/lib/views/screens/nc_login_screen.dart +++ b/lib/views/screens/nc_login_screen.dart @@ -16,44 +16,44 @@ class NextCloudLoginScreen extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text("Sign in..."), - ), - body: WebView( - key: UniqueKey(), - initialUrl: this._url.toString(), - userAgent: "Nextcloud Yaga", - javascriptMode: JavascriptMode.unrestricted, - onWebViewCreated: (WebViewController webViewController) { - webViewController.loadUrl( - this._url.toString() + "/index.php/login/flow", - headers: {"OCS-APIREQUEST": "true"}); - }, - navigationDelegate: (NavigationRequest request) { - if (request.url.startsWith("nc")) { - //string of type: nc://login/server:&user:&password: - Map ncParas = request.url - .split("nc://login/")[1] - .split("&") - .map((e) => e.split(":")) - .map((e) => {e.removeAt(0): e.join(":")}) - .reduce((value, element) { - value.addAll(element); - return value; - }); + appBar: AppBar( + title: Text("Sign in..."), + ), + body: WebView( + key: UniqueKey(), + userAgent: "Nextcloud Yaga", + javascriptMode: JavascriptMode.unrestricted, + onWebViewCreated: (WebViewController webViewController) { + webViewController.loadUrl( + this._url.toString() + "/index.php/login/flow", + headers: {"OCS-APIREQUEST": "true"}); + }, + navigationDelegate: (NavigationRequest request) async { + if (request.url.startsWith("nc")) { + //string of type: nc://login/server:&user:&password: + Map ncParas = request.url + .split("nc://login/")[1] + .split("&") + .map((e) => e.split(":")) + .map((e) => {e.removeAt(0): e.join(":")}) + .reduce((value, element) { + value.addAll(element); + return value; + }); - getIt.get().loginCommand(NextCloudLoginData( - Uri.parse(ncParas[NextCloudLoginDataKeys.server]), - Uri.decodeComponent(ncParas[NextCloudLoginDataKeys.user]), - ncParas[NextCloudLoginDataKeys.password])); + getIt.get().loginCommand(NextCloudLoginData( + Uri.parse(ncParas[NextCloudLoginDataKeys.server]), + Uri.decodeComponent(ncParas[NextCloudLoginDataKeys.user]), + ncParas[NextCloudLoginDataKeys.password])); - Navigator.popUntil( - context, ModalRoute.withName(YagaHomeScreen.route)); - return NavigationDecision.prevent; - } + Navigator.popUntil( + context, ModalRoute.withName(YagaHomeScreen.route)); + return NavigationDecision.prevent; + } - return NavigationDecision.navigate; - }, - )); + return NavigationDecision.navigate; + }, + ), + ); } } diff --git a/pubspec.yaml b/pubspec.yaml index d24257c..8af0e06 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: A Nextcloud gallary app. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 0.17.4+1704 +version: 0.17.5+1705 environment: sdk: ">=2.7.0 <3.0.0"