mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-16 00:08:59 +00:00
update navigation index before currenteventchange
This commit is contained in:
@@ -167,14 +167,14 @@ pub fn pushEntry(
|
|||||||
// we don't always have a current entry...
|
// we don't always have a current entry...
|
||||||
const previous = if (self.entries.items.len > 0) self.currentEntry() else null;
|
const previous = if (self.entries.items.len > 0) self.currentEntry() else null;
|
||||||
try self.entries.append(arena, entry);
|
try self.entries.append(arena, entry);
|
||||||
|
self.index = index;
|
||||||
|
|
||||||
if (previous) |prev| {
|
if (previous) |prev| {
|
||||||
if (dispatch) {
|
if (dispatch) {
|
||||||
NavigationCurrentEntryChangeEvent.dispatch(self, prev, .push);
|
NavigationCurrentEntryChangeEvent.dispatch(self, prev, .push);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.index = index;
|
|
||||||
|
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user