Dynamic sync

This commit is contained in:
2026-07-29 13:52:47 +03:00
parent 0b0b9f307d
commit 6906f1416f
2 changed files with 39 additions and 13 deletions
+11 -1
View File
@@ -2,7 +2,7 @@ use crate::data_provider::settings::{delete_settings, set_setting};
use crate::dictionary::app_data_dir;
use crate::sync::SyncMessage::NextAnimation;
use crate::Page::PreviousPage;
use crate::{AppState, NavigatedPage, Page, RootMessage, DEFAULT_SPACING};
use crate::{fill_state, AppState, NavigatedPage, Page, RootMessage, DEFAULT_SPACING};
use iced::widget::button::danger;
use iced::widget::container::rounded_box;
use iced::widget::{button, column, container, progress_bar, row, space, text};
@@ -130,6 +130,16 @@ impl SyncState {
}
SyncMessage::NetworkFinished => {
self.frozen = false;
let mut updated_state = AppState::new();
fill_state(&mut updated_state);
let mut state = self.state.lock().unwrap();
state.sync_data = updated_state.sync_data;
state.connection = updated_state.connection;
state.card_sets = updated_state.card_sets;
state.dictionary = updated_state.dictionary;
state.word_groups = updated_state.word_groups;
}
SyncMessage::Disable => {}
SyncMessage::DisableSync => {