1
0
This commit is contained in:
Zef Hemel 2024-01-24 14:52:07 +01:00
parent 8a89d69c22
commit 308b1232bc

View File

@ -44,6 +44,9 @@ export function PageNavigator({
if (isFederationPath(pageMeta.name)) {
orderId = Math.round(orderId / 10); // Just 10x lower the timestamp to push them down, should work
}
if (mode === "page") {
// Special behavior for regular pages
let description: string | undefined;
let aliases: string[] = [];
if (pageMeta.displayName) {
@ -64,6 +67,17 @@ export function PageNavigator({
description,
orderId: orderId,
});
} else {
// Special behavior for templates
options.push({
...pageMeta,
// Use the displayName or last bit of the path as the name
name: pageMeta.displayName || pageMeta.name.split("/").pop()!,
// And use the full path as the description
description: pageMeta.name,
orderId: orderId,
});
}
}
let completePrefix = currentPage + "/";
if (currentPage && currentPage.includes("/")) {
@ -116,7 +130,7 @@ export function PageNavigator({
newHint={`Create ${mode}`}
completePrefix={completePrefix}
onSelect={(opt) => {
onNavigate(opt?.name);
onNavigate(opt?.ref);
}}
/>
);