new: update active profile and its ping,
This commit is contained in:
@@ -13,8 +13,8 @@
|
||||
"sortBy": "مرتبسازی براساس",
|
||||
"addToClipboard": "به کلیپ بورد اضافه کنید",
|
||||
"notSet": "تنظیم نشده",
|
||||
"agree": "موافق",
|
||||
"decline": "کاهش می یابد",
|
||||
"agree": "موافقم",
|
||||
"decline": "رد",
|
||||
"unknown": "ناشناخته"
|
||||
},
|
||||
"intro": {
|
||||
|
||||
@@ -26,7 +26,8 @@ class ActiveProxyDelayIndicator extends HookConsumerWidget {
|
||||
onTap: () async {
|
||||
await ref
|
||||
.read(activeProxyNotifierProvider.notifier)
|
||||
.urlTest(value.proxy.tag);
|
||||
// .urlTest(value.proxy.tag);
|
||||
.urlTest("auto");
|
||||
},
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
child: Padding(
|
||||
@@ -42,7 +43,7 @@ class ActiveProxyDelayIndicator extends HookConsumerWidget {
|
||||
TextSpan(
|
||||
children: [
|
||||
TextSpan(
|
||||
text: delay.toString(),
|
||||
text: delay > 65000 ? "×" : delay.toString(),
|
||||
style: theme.textTheme.titleMedium
|
||||
?.copyWith(fontWeight: FontWeight.bold),
|
||||
),
|
||||
|
||||
@@ -26,7 +26,25 @@ Stream<ProxyItemEntity?> activeProxyGroup(ActiveProxyGroupRef ref) async* {
|
||||
.watch(proxyRepositoryProvider)
|
||||
.watchActiveProxies()
|
||||
.map((event) => event.getOrElse((l) => throw l))
|
||||
.map((event) => event.firstOrNull?.items.firstOrNull);
|
||||
.map((event) {
|
||||
final Map<String, ProxyGroupEntity> itemMap =
|
||||
event.fold({}, (Map<String, ProxyGroupEntity> map, item) {
|
||||
map[item.tag] = item;
|
||||
return map;
|
||||
});
|
||||
|
||||
// Start from the item with the tag "Select"
|
||||
var current = itemMap["select"];
|
||||
ProxyItemEntity? selected;
|
||||
|
||||
// Traverse through the map based on the selected tag until reaching the end
|
||||
while (current != null) {
|
||||
selected = current.items.firstOrNull;
|
||||
current = itemMap[selected?.tag];
|
||||
}
|
||||
|
||||
return selected;
|
||||
});
|
||||
}
|
||||
|
||||
@riverpod
|
||||
|
||||
Reference in New Issue
Block a user