1
0

Fixed a bunch of bugs around page navigation and renaming

This commit is contained in:
Zef Hemel
2022-08-01 15:06:32 +02:00
parent 339a8a9402
commit ca796b9c95
7 changed files with 45 additions and 16 deletions
+5 -3
View File
@@ -12,15 +12,17 @@ export function PageNavigator({
}) {
let options: FilterOption[] = [];
for (let pageMeta of allPages) {
if (currentPage && currentPage === pageMeta.name) {
continue;
}
// Order by last modified date in descending order
let orderId = -pageMeta.lastModified;
// Unless it was opened in this session
if (pageMeta.lastOpened) {
orderId = -pageMeta.lastOpened;
}
// Or it's the currently open page
if (currentPage && currentPage === pageMeta.name) {
// ... then we put it all the way to the end
orderId = Infinity;
}
options.push({
...pageMeta,
orderId: orderId,