Fix bugs
This commit is contained in:
@@ -23,7 +23,6 @@ class AppRepositoryImpl
|
||||
version: packageInfo.version,
|
||||
buildNumber: packageInfo.buildNumber,
|
||||
release: Release.read(),
|
||||
installerMedia: packageInfo.installerStore,
|
||||
operatingSystem: Platform.operatingSystem,
|
||||
operatingSystemVersion: Platform.operatingSystemVersion,
|
||||
environment: environment,
|
||||
|
||||
@@ -79,7 +79,7 @@ class CoreFacadeImpl with ExceptionHandler, InfraLogger implements CoreFacade {
|
||||
) {
|
||||
return exceptionHandler(
|
||||
() {
|
||||
loggy.debug("changing config options: $options");
|
||||
loggy.info("changing config options: ${options.format()}");
|
||||
return singbox
|
||||
.changeConfigOptions(options)
|
||||
.mapLeft(CoreServiceFailure.invalidConfigOptions)
|
||||
|
||||
@@ -14,7 +14,6 @@ class AppInfo with _$AppInfo {
|
||||
required String version,
|
||||
required String buildNumber,
|
||||
required Release release,
|
||||
String? installerMedia,
|
||||
required String operatingSystem,
|
||||
required String operatingSystemVersion,
|
||||
required Environment environment,
|
||||
@@ -28,8 +27,8 @@ class AppInfo with _$AppInfo {
|
||||
|
||||
/// formats app info for sharing
|
||||
String format() => '''
|
||||
$name v$version ($buildNumber) ${environment.name}
|
||||
${release.name} release ${installerMedia != null ? "via $installerMedia" : ""}
|
||||
$name v$version ($buildNumber) [${environment.name}]
|
||||
${release.name} release
|
||||
$operatingSystem [$operatingSystemVersion]''';
|
||||
|
||||
factory AppInfo.fromJson(Map<String, dynamic> json) =>
|
||||
|
||||
@@ -23,6 +23,15 @@ sealed class ConnectionStatus with _$ConnectionStatus {
|
||||
_ => false,
|
||||
};
|
||||
|
||||
String format() => switch (this) {
|
||||
Disconnected(:final connectionFailure) => connectionFailure != null
|
||||
? "CONNECTION FAILURE: $connectionFailure"
|
||||
: "DISCONNECTED",
|
||||
Connecting() => "CONNECTING",
|
||||
Connected() => "CONNECTED",
|
||||
Disconnecting() => "DISCONNECTING",
|
||||
};
|
||||
|
||||
String present(TranslationsEn t) => switch (this) {
|
||||
Disconnected() => t.home.connection.tapToConnect,
|
||||
Connecting() => t.home.connection.connecting,
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:hiddify/domain/core_facade.dart';
|
||||
import 'package:hiddify/features/common/active_profile/active_profile_notifier.dart';
|
||||
import 'package:hiddify/utils/utils.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
import 'package:rxdart/rxdart.dart';
|
||||
|
||||
part 'connectivity_controller.g.dart';
|
||||
|
||||
@@ -21,7 +22,9 @@ class ConnectivityController extends _$ConnectivityController with AppLogger {
|
||||
}
|
||||
},
|
||||
);
|
||||
return _core.watchConnectionStatus();
|
||||
return _core.watchConnectionStatus().doOnData((event) {
|
||||
loggy.info("connection status: ${event.format()}");
|
||||
});
|
||||
}
|
||||
|
||||
CoreFacade get _core => ref.watch(coreFacadeProvider);
|
||||
|
||||
@@ -120,11 +120,13 @@ class ProfileTile extends HookConsumerWidget {
|
||||
Flexible(
|
||||
child: Text(
|
||||
profile.name,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: theme.textTheme.titleMedium,
|
||||
semanticsLabel: t.profile
|
||||
.activeProfileNameSemanticLabel(
|
||||
name: profile.name,
|
||||
),
|
||||
style: theme.textTheme.titleMedium,
|
||||
),
|
||||
),
|
||||
const Icon(Icons.arrow_drop_down),
|
||||
@@ -135,6 +137,9 @@ class ProfileTile extends HookConsumerWidget {
|
||||
else
|
||||
Text(
|
||||
profile.name,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: theme.textTheme.titleMedium,
|
||||
semanticsLabel: profile.active
|
||||
? t.profile.activeProfileNameSemanticLabel(
|
||||
name: profile.name,
|
||||
@@ -142,7 +147,6 @@ class ProfileTile extends HookConsumerWidget {
|
||||
: t.profile.nonActiveProfileBtnSemanticLabel(
|
||||
name: profile.name,
|
||||
),
|
||||
style: theme.textTheme.titleMedium,
|
||||
),
|
||||
if (subInfo != null) ...[
|
||||
const Gap(4),
|
||||
|
||||
Reference in New Issue
Block a user