mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 08:37:22 +00:00
Display git provider favicon in SyncStep
This commit is contained in:
4 files changed
+22
-31
No files matched your search
@@ -44,7 +44,6 @@ import { useCurrentUser } from '@/hooks/useCurrentUser';
|
||||
import { Link } from 'react-router-dom';
|
||||
import type { DeployProvider } from '@/contexts/DeploySettingsContext';
|
||||
import { ExternalFavicon } from '@/components/ExternalFavicon';
|
||||
import { normalizeUrl } from '@/lib/url';
|
||||
|
||||
interface PresetProvider {
|
||||
id: string;
|
||||
@@ -377,6 +376,22 @@ function generateCustomProviderId(type: string): string {
|
||||
return `${type}-${randomSegment}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize a URL string to ensure it has a protocol
|
||||
* @param url - The URL string to normalize
|
||||
* @returns A fully-qualified URL string
|
||||
*/
|
||||
function normalizeUrl(url: string): string {
|
||||
// If it already has a protocol, return as-is
|
||||
if (/^https?:\/\//i.test(url)) {
|
||||
return url;
|
||||
}
|
||||
|
||||
// Add https:// prefix
|
||||
return `https://${url}`;
|
||||
}
|
||||
|
||||
|
||||
function getProviderUrl(provider: DeployProvider | PresetProvider): string | null {
|
||||
switch (provider.type) {
|
||||
case 'shakespeare':
|
||||
|
||||
Reference in new issue
Block a user