feat: support updating the view name and icon through document (#3099)

* feat: support updating the view name and icon through document

* fix: store expand pages

* fix: refactor text link

* fix: update cargo.toml

* fix: update test

* fix: update event map

* fix: move deal with icon codes to a single file

* fix: delete useless code from flutter

* fix: document banner

* fix: build error

* fix: update rust library

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
This commit is contained in:
Kilu.He
2023-08-04 19:27:14 +08:00
committed by GitHub
parent 70914e6228
commit 16a01e11ed
91 changed files with 1293 additions and 1295 deletions

View File

@ -42,19 +42,18 @@ impl UserLocalDataMigration {
pub fn run(self, migrations: Vec<Box<dyn UserDataMigration>>) -> FlowyResult<Vec<String>> {
let mut applied_migrations = vec![];
let conn = self.sqlite_pool.get()?;
let record = get_all_records(&*conn)?;
let record = get_all_records(&conn)?;
let mut duplicated_names = vec![];
for migration in migrations {
if record
if !record
.iter()
.find(|record| record.migration_name == migration.name())
.is_none()
.any(|record| record.migration_name == migration.name())
{
let migration_name = migration.name().to_string();
if !duplicated_names.contains(&migration_name) {
migration.run(&self.session, &self.collab_db)?;
applied_migrations.push(migration.name().to_string());
save_record(&*conn, &migration_name);
save_record(&conn, &migration_name);
duplicated_names.push(migration_name);
} else {
tracing::error!("Duplicated migration name: {}", migration_name);

View File

@ -86,7 +86,7 @@ impl UserSession {
.run(vec![Box::new(HistoricalEmptyDocumentMigration)])
{
Ok(applied_migrations) => {
if applied_migrations.len() > 0 {
if !applied_migrations.is_empty() {
tracing::info!("Did apply migrations: {:?}", applied_migrations);
}
},