remove tor detector
This commit is contained in:
parent
2b08ad928b
commit
3eafe997c9
|
|
@ -7,7 +7,6 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
import 'package:flutter_web_auth_2/flutter_web_auth_2.dart';
|
import 'package:flutter_web_auth_2/flutter_web_auth_2.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:hive_flutter/hive_flutter.dart';
|
|
||||||
import 'package:matrix/matrix.dart';
|
import 'package:matrix/matrix.dart';
|
||||||
import 'package:universal_html/html.dart' as html;
|
import 'package:universal_html/html.dart' as html;
|
||||||
import 'package:url_launcher/url_launcher_string.dart';
|
import 'package:url_launcher/url_launcher_string.dart';
|
||||||
|
|
@ -20,8 +19,6 @@ import 'package:extera_next/widgets/adaptive_dialogs/show_ok_cancel_alert_dialog
|
||||||
import 'package:extera_next/widgets/matrix.dart';
|
import 'package:extera_next/widgets/matrix.dart';
|
||||||
import '../../utils/localized_exception_extension.dart';
|
import '../../utils/localized_exception_extension.dart';
|
||||||
|
|
||||||
import 'package:extera_next/utils/tor_stub.dart'
|
|
||||||
if (dart.library.html) 'package:tor_detector_web/tor_detector_web.dart';
|
|
||||||
|
|
||||||
class HomeserverPicker extends StatefulWidget {
|
class HomeserverPicker extends StatefulWidget {
|
||||||
final bool addMultiAccount;
|
final bool addMultiAccount;
|
||||||
|
|
@ -40,26 +37,6 @@ class HomeserverPickerController extends State<HomeserverPicker> {
|
||||||
|
|
||||||
String? error;
|
String? error;
|
||||||
|
|
||||||
bool isTorBrowser = false;
|
|
||||||
|
|
||||||
Future<void> _checkTorBrowser() async {
|
|
||||||
if (!kIsWeb) return;
|
|
||||||
|
|
||||||
Hive.openBox('test').then((value) => null).catchError(
|
|
||||||
(e, s) async {
|
|
||||||
await showOkAlertDialog(
|
|
||||||
context: context,
|
|
||||||
title: L10n.of(context).indexedDbErrorTitle,
|
|
||||||
message: L10n.of(context).indexedDbErrorLong,
|
|
||||||
);
|
|
||||||
_checkTorBrowser();
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
final isTor = await TorBrowserDetector.isTorBrowser;
|
|
||||||
isTorBrowser = isTor;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Starts an analysis of the given homeserver. It uses the current domain and
|
/// Starts an analysis of the given homeserver. It uses the current domain and
|
||||||
/// makes sure that it is prefixed with https. Then it searches for the
|
/// makes sure that it is prefixed with https. Then it searches for the
|
||||||
/// well-known information and forwards to the login page depending on the
|
/// well-known information and forwards to the login page depending on the
|
||||||
|
|
@ -90,7 +67,7 @@ class HomeserverPickerController extends State<HomeserverPicker> {
|
||||||
homeserver = Uri.https(homeserverInput, '');
|
homeserver = Uri.https(homeserverInput, '');
|
||||||
}
|
}
|
||||||
final client = await Matrix.of(context).getLoginClient();
|
final client = await Matrix.of(context).getLoginClient();
|
||||||
final (_, _, loginFlows) = await client.checkHomeserver(homeserver);
|
final (_, _, loginFlows, _) = await client.checkHomeserver(homeserver);
|
||||||
this.loginFlows = loginFlows;
|
this.loginFlows = loginFlows;
|
||||||
if (supportsSso && !legacyPasswordLogin) {
|
if (supportsSso && !legacyPasswordLogin) {
|
||||||
if (!PlatformInfos.isMobile) {
|
if (!PlatformInfos.isMobile) {
|
||||||
|
|
@ -187,7 +164,6 @@ class HomeserverPickerController extends State<HomeserverPicker> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
_checkTorBrowser();
|
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ class HomeserverPickerView extends StatelessWidget {
|
||||||
// users. This feature is just some UX sugar as TOR users are
|
// users. This feature is just some UX sugar as TOR users are
|
||||||
// usually forced to logout as TOR browser is non-persistent
|
// usually forced to logout as TOR browser is non-persistent
|
||||||
AnimatedContainer(
|
AnimatedContainer(
|
||||||
height: controller.isTorBrowser ? 64 : 0,
|
height: 0,
|
||||||
duration: FluffyThemes.animationDuration,
|
duration: FluffyThemes.animationDuration,
|
||||||
curve: FluffyThemes.animationCurve,
|
curve: FluffyThemes.animationCurve,
|
||||||
clipBehavior: Clip.hardEdge,
|
clipBehavior: Clip.hardEdge,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue