Hotfixes trail visibility

This commit is contained in:
Christian Beutel
2025-06-21 11:52:28 +02:00
parent 0c7718cc24
commit b5a3864f04
3 changed files with 25 additions and 8 deletions

View File

@@ -533,21 +533,21 @@ function buildFilterText(user: AuthRecord, filter: TrailFilter, includeGeo: bool
if (showPublic === true) {
filterText += "(public = TRUE";
if (showPrivate === true && (!filter.author?.length || filter.author == user?.id)) {
filterText += ` OR author = ${user?.id}`;
if (showPrivate === true && (!filter.author?.length || filter.author == user?.actor)) {
filterText += ` OR author = ${user?.actor}`;
}
filterText += ")";
}
else if (!filter.author?.length || filter.author == user?.id) {
else if (!filter.author?.length || filter.author == user?.actor) {
filterText += "public = FALSE";
filterText += ` AND author = ${user?.id}`;
filterText += ` AND author = ${user?.actor}`;
}
if (filter.shared !== undefined) {
if (filter.shared === true) {
filterText += ` OR shares = ${user?.id}`
filterText += ` OR shares = ${user?.actor}`
} else {
filterText += ` AND NOT shares = ${user?.id}`
filterText += ` AND NOT shares = ${user?.actor}`
}
}