speedup loading some pages (reduce data amount of trail lists) (#236)
* speedup loading some pages (reduce data amount of trail lists) * optimize code * fix save bio, if no tileset defined
This commit is contained in:
@@ -13,7 +13,7 @@ const SettingsCreateSchema = z.object({
|
||||
lon: z.number()
|
||||
}).optional().nullable(),
|
||||
category: z.string().optional(),
|
||||
tilesets: z.array(z.object({ name: z.string(), url: z.string().url() })).optional(),
|
||||
tilesets: z.array(z.object({ name: z.string(), url: z.string().url() })).optional().nullable(),
|
||||
terrain: z.object({ terrain: z.string().url(), hillshading: z.string().url() }).optional().nullable(),
|
||||
user: z.string().optional(),
|
||||
privacy: z.object({
|
||||
|
||||
@@ -35,4 +35,35 @@ export interface ListFilter {
|
||||
public?: boolean;
|
||||
shared?: boolean;
|
||||
sortOrder?: "+" | "-"
|
||||
}
|
||||
}
|
||||
|
||||
export const enum ExpandType {
|
||||
None = 0,
|
||||
Trails = 1 << 0,
|
||||
Waypoints = 1 << 1,
|
||||
TrailCategories = 1 << 2,
|
||||
ListShares = 1 << 3,
|
||||
All = ~(~0 << 4),
|
||||
}
|
||||
|
||||
export function ExpandTypeToString(e: ExpandType) : string {
|
||||
|
||||
if (e == ExpandType.None)
|
||||
return "";
|
||||
|
||||
var ret = "";
|
||||
if ((e & ExpandType.Trails) === ExpandType.Trails) {
|
||||
ret += "trails,";
|
||||
}
|
||||
if ((e & ExpandType.Waypoints) === ExpandType.Waypoints) {
|
||||
ret += "trails.waypoints,";
|
||||
}
|
||||
if ((e & ExpandType.TrailCategories) === ExpandType.TrailCategories) {
|
||||
ret += "trails.category,";
|
||||
}
|
||||
if ((e & ExpandType.ListShares) === ExpandType.ListShares) {
|
||||
ret += "list_share_via_list,";
|
||||
}
|
||||
|
||||
return ret.slice(0, -1);
|
||||
}
|
||||
Reference in New Issue
Block a user