Fix backup restore settings and ordering
Apply restored eviction and list sorting settings before reloading data; stabilize the message-filter ingestion test against queued review history.
This commit is contained in:
1 parent
c0702806de
commit
37bfdd47fe
7 files changed
+94
No files matched your search
@@ -2133,6 +2133,8 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<void> reloadChannelOrder() => _loadChannelOrder();
|
||||
|
||||
/// History is stored by channel ID, so it may carry the slot the channel
|
||||
/// sat in when it was saved; rebind it to the slot it is shown in now.
|
||||
List<ChannelMessage> _bindToSlot(List<ChannelMessage> messages, int slot) => [
|
||||
|
||||
@@ -16,6 +16,7 @@ import '../services/app_settings_service.dart';
|
||||
import '../services/backup_service.dart';
|
||||
import '../services/image_codec_service.dart';
|
||||
import '../services/translation_service.dart';
|
||||
import '../services/ui_view_state_service.dart';
|
||||
import '../services/message_filter/message_filter_service.dart';
|
||||
import '../utils/platform_info.dart';
|
||||
import '../utils/share_origin.dart';
|
||||
@@ -432,6 +433,7 @@ class _BackupRestoreScreenState extends State<BackupRestoreScreen> {
|
||||
final l10n = context.l10n;
|
||||
final connector = context.read<MeshCoreConnector>();
|
||||
final appSettingsService = context.read<AppSettingsService>();
|
||||
final uiViewStateService = context.read<UiViewStateService>();
|
||||
final messageFilterService = context.read<MessageFilterService>();
|
||||
final translationService = context.read<TranslationService>();
|
||||
final imageCodecService = context.read<ImageCodecService>();
|
||||
@@ -454,6 +456,7 @@ class _BackupRestoreScreenState extends State<BackupRestoreScreen> {
|
||||
)) {
|
||||
await appSettingsService.loadSettings();
|
||||
if (_selectedItems.contains(BackupItem.appSettings)) {
|
||||
await uiViewStateService.reload();
|
||||
await _offerMissingModels(
|
||||
appSettingsService,
|
||||
translationService,
|
||||
|
||||
@@ -485,6 +485,12 @@ class BackupService {
|
||||
);
|
||||
}
|
||||
}
|
||||
if (selectedItems.contains(BackupItem.appSettings)) {
|
||||
await appSettingsService.loadSettings();
|
||||
}
|
||||
if (selectedItems.contains(BackupItem.channelSettings)) {
|
||||
await connector.reloadChannelOrder();
|
||||
}
|
||||
if (!importingIdentity &&
|
||||
selectedItems.contains(BackupItem.discoveredContacts)) {
|
||||
await connector.reloadDiscoveredContacts();
|
||||
|
||||
@@ -109,6 +109,11 @@ class UiViewStateService extends ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> reload() async {
|
||||
await initialize();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setContactsSelectedGroupName(String value) {
|
||||
if (_contactsSelectedGroupName == value) return;
|
||||
_contactsSelectedGroupName = value;
|
||||
|
||||
Reference in new issue
Block a user