feat: expose presets in view options

This commit is contained in:
Carlos Valente
2025-07-21 16:19:09 +02:00
committed by Carlos Valente
parent 5f8a5c4995
commit 307f0ffd34
16 changed files with 111 additions and 27 deletions
+2 -2
View File
@@ -136,9 +136,9 @@ export function arePathsEquivalent(currentPath: string, newPath: string): boolea
* Generates a URL preset from a user given alias and URL.
*/
export function generateUrlPresetOptions(alias: string, userUrl: string): URLPreset {
let sanitisedUrl = userUrl.toLowerCase();
let sanitisedUrl = userUrl;
// we need to ensure the URL has a protocol, but it doesnt matter which
if (!checkRegex.startsWithHttp(sanitisedUrl)) {
if (!checkRegex.startsWithHttp(userUrl.toLowerCase())) {
sanitisedUrl = `http://${sanitisedUrl}`;
}