Commit 7a1ab2e2 authored by Christian Sadilek's avatar Christian Sadilek
Browse files

Closes #3721: Restored sessions do not get a BrowserStore assigned

parent a1c339ba
......@@ -220,7 +220,8 @@ class LegacySessionManager(
engineSession = it.engineSession,
engineSessionState = it.engineSessionState,
parent = null,
viaRestore = true)
viaRestore = true
)
}
if (updateSelection) {
......
......@@ -122,6 +122,9 @@ class SessionManager(
* @param updateSelection Whether the selected session should be updated from the restored snapshot.
*/
fun restore(snapshot: Snapshot, updateSelection: Boolean = true) {
// Add store to each Session so that it can dispatch actions whenever it changes.
snapshot.sessions.forEach { it.session.store = store }
delegate.restore(snapshot, updateSelection)
val tabs = snapshot.sessions
......
......@@ -324,6 +324,9 @@ class SessionManagerMigrationTest {
assertEquals("https://example.org/private2", store.state.selectedTab!!.content.url)
assertEquals("private2", store.state.selectedTabId)
manager.sessions.forEachIndexed { index, session ->
assertEquals("Incorrect browser store on session ${session.id} at index $index", store, session.store)
}
assertEquals("https://www.mozilla.org", manager.sessions[0].url)
assertEquals("https://www.mozilla.org", store.state.tabs[0].content.url)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment