]> uap-core.de Git - note.git/commitdiff
fix fixed_title update in save_note
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Sun, 2 Aug 2026 14:37:51 +0000 (16:37 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Sun, 2 Aug 2026 14:37:51 +0000 (16:37 +0200)
application/backend/src/backend.rs
application/note/src/note.rs

index 823b2f04b6168f5c6f07c2a50476e4c6c41117e6..cf005717aa87e4808a8adbf5879e2fdca8d3e739 100644 (file)
@@ -549,6 +549,9 @@ impl BackendHandle {
                 if let Set(title) = note.title {
                     update = update.col_expr(Column::Title, Expr::value(title));
                 }
+                if let Set(fixed_title) = note.fixed_title {
+                    update = update.col_expr(Column::FixedTitle, Expr::value(fixed_title));
+                }
 
                 let uresult = update
                     .col_expr(Column::Lastmodified, Expr::value(Utc::now()))
@@ -691,10 +694,10 @@ impl BackendHandle {
 
             let mut update = Note::update_many();
             if let Some(nodename ) = &nodename {
-                update = update.col_expr(Column::Nodename, Expr::value(nodename.clone())).col_expr(Column::FixedTitle, Expr::value(true));
+                update = update.col_expr(Column::Nodename, Expr::value(nodename.clone()));
             }
             if let Some(title ) = &title {
-                update = update.col_expr(Column::Title, Expr::value(title));
+                update = update.col_expr(Column::Title, Expr::value(title)).col_expr(Column::FixedTitle, Expr::value(true));
             }
 
             let result = update
index 07c3fbf5f617974c5798ff41487134fb98c2e36c..26a353bbcab1826f93100c6502eee86ab8f51758 100644 (file)
@@ -387,7 +387,6 @@ impl Note {
             return;
         };
         doc.ctx.set_state(AppStates::NoteTitleInput as i32);
-        self.fixed_title = true;
     }
 
     #[action]
@@ -407,6 +406,7 @@ impl Note {
         let title = self.title.get();
         self.notify_title_change(title.as_str());
         self.modified = true;
+        self.fixed_title = true;
     }
 
     #[action]
@@ -486,7 +486,6 @@ impl Note {
                                                             eprintln!("rename_note: unexpected number of rows affected");
                                                         } else {
                                                             note.nodename = Some(new_nodename);
-                                                            note.fixed_title = true;
                                                         }
                                                     },
                                                     Err(e) => {