mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 17:20:08 +00:00
draft db session features
This commit is contained in:
parent
395551e14c
commit
845ccf6d87
@ -253,7 +253,8 @@ impl Tab {
|
||||
pub fn restore(&self, tx: &Transaction, app_browser_window_id: &i64) {
|
||||
match self.database.records(tx, app_browser_window_id) {
|
||||
Ok(records) => {
|
||||
for _ in records {
|
||||
for record in records {
|
||||
self.append(None, true /*@ TODO record.is_current_page */);
|
||||
// Delegate restore action to childs
|
||||
// nothing yet..
|
||||
}
|
||||
@ -263,13 +264,16 @@ impl Tab {
|
||||
}
|
||||
|
||||
pub fn save(&self, tx: &Transaction, app_browser_window_id: &i64) {
|
||||
match self.database.add(tx, app_browser_window_id) {
|
||||
Ok(_) => {
|
||||
// Delegate save action to childs
|
||||
// let id = self.database.last_insert_id(tx);
|
||||
// nothing yet..
|
||||
for (id, item) in self.index.take().iter() {
|
||||
match self.database.add(tx, app_browser_window_id) {
|
||||
Ok(_) => {
|
||||
// Delegate save action to childs
|
||||
let id = self.database.last_insert_id(tx);
|
||||
// item.label.save()
|
||||
// item.page.save()
|
||||
}
|
||||
Err(e) => todo!("{e}"),
|
||||
}
|
||||
Err(e) => todo!("{e}"),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,8 +60,7 @@ impl Database {
|
||||
tx.execute("DELETE FROM `app_browser_window_tab` WHERE `id` = ?", [id])
|
||||
}
|
||||
|
||||
/* not in use
|
||||
pub fn last_insert_id(&self, tx: &Transaction) -> i64 {
|
||||
tx.last_insert_rowid()
|
||||
} */
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user