fix: harden onboarding completion
This commit is contained in:
1 parent
576cc0b418
commit
07770e862c
44 files changed
+3003
-1000
No files matched your search
@@ -0,0 +1,21 @@
|
||||
export const takeNewSourceIds = (sourceIds: string[], seenSourceIds: Set<string>) =>
|
||||
sourceIds.filter((sourceId) => {
|
||||
if (seenSourceIds.has(sourceId)) return false;
|
||||
seenSourceIds.add(sourceId);
|
||||
return true;
|
||||
});
|
||||
|
||||
export const resolveDiscoveredAppUrl = (
|
||||
override: string | undefined,
|
||||
suggestedUrl: string | null,
|
||||
generatedUrl: string | null,
|
||||
) => override ?? suggestedUrl ?? generatedUrl ?? "";
|
||||
|
||||
export const isHttpUrl = (value: string) => {
|
||||
try {
|
||||
const protocol = new URL(value).protocol;
|
||||
return protocol === "http:" || protocol === "https:";
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user