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