| ... | ... | @@ -738,11 +738,14 @@ impl State { |
| 738 | 738 | .is_some_and(|session| Arc::ptr_eq(session.section.replica(), &replica)); |
| 739 | 739 | if open { |
| 740 | 740 | state.persist()?; |
| 741 | | let pending = replica.pending()?.last().map_or(0, |edit| edit.id); |
| 742 | | if pending > through { |
| 743 | | state.set_password(library, path, key, password); |
| 744 | | return Ok(()); |
| 745 | | } |
| 741 | } |
| 742 | let pending = replica.pending()?.last().map_or(0, |edit| edit.id); |
| 743 | if open && pending > through { |
| 744 | state.set_password(library, path, key, password); |
| 745 | return Ok(()); |
| 746 | } |
| 747 | if pending > 0 { |
| 748 | return Err("Edits to the section wait to be published".into()); |
| 746 | 749 | } |
| 747 | 750 | let stopping = state |
| 748 | 751 | .session |