remove tor detector

This commit is contained in:
OfficialDakari 2025-11-19 18:49:44 +05:00
parent 2b08ad928b
commit 3eafe997c9
2 changed files with 2 additions and 26 deletions

View File

@ -7,7 +7,6 @@ import 'package:flutter/material.dart';
import 'package:collection/collection.dart';
import 'package:flutter_web_auth_2/flutter_web_auth_2.dart';
import 'package:go_router/go_router.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:matrix/matrix.dart';
import 'package:universal_html/html.dart' as html;
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 '../../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 {
final bool addMultiAccount;
@ -40,26 +37,6 @@ class HomeserverPickerController extends State<HomeserverPicker> {
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
/// 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
@ -90,7 +67,7 @@ class HomeserverPickerController extends State<HomeserverPicker> {
homeserver = Uri.https(homeserverInput, '');
}
final client = await Matrix.of(context).getLoginClient();
final (_, _, loginFlows) = await client.checkHomeserver(homeserver);
final (_, _, loginFlows, _) = await client.checkHomeserver(homeserver);
this.loginFlows = loginFlows;
if (supportsSso && !legacyPasswordLogin) {
if (!PlatformInfos.isMobile) {
@ -187,7 +164,6 @@ class HomeserverPickerController extends State<HomeserverPicker> {
@override
void initState() {
_checkTorBrowser();
super.initState();
}

View File

@ -86,7 +86,7 @@ class HomeserverPickerView extends StatelessWidget {
// users. This feature is just some UX sugar as TOR users are
// usually forced to logout as TOR browser is non-persistent
AnimatedContainer(
height: controller.isTorBrowser ? 64 : 0,
height: 0,
duration: FluffyThemes.animationDuration,
curve: FluffyThemes.animationCurve,
clipBehavior: Clip.hardEdge,