Cleanup and federation prep

This commit is contained in:
Zef Hemel
2023-07-30 08:56:44 +02:00
parent fe4887dc78
commit afa160d2c2
7 changed files with 98 additions and 32 deletions
+5 -1
View File
@@ -3,7 +3,7 @@ export function resolvePath(
pathToResolve: string,
fullUrl = false,
): string {
if (currentPage.startsWith("!") && !pathToResolve.startsWith("!")) {
if (isFederationPath(currentPage) && !isFederationPath(pathToResolve)) {
let domainPart = currentPage.split("/")[0];
if (fullUrl) {
domainPart = domainPart.substring(1);
@@ -18,3 +18,7 @@ export function resolvePath(
return pathToResolve;
}
}
export function isFederationPath(path: string) {
return path.startsWith("!");
}