feat: support change media upload service

This commit is contained in:
codytseng
2025-04-08 14:23:16 +08:00
parent 2e552c356c
commit bc0fa7f528
11 changed files with 198 additions and 41 deletions

View File

@@ -35,11 +35,12 @@ export const toOthersRelaySettings = (pubkey: string) => {
const npub = nip19.npubEncode(pubkey)
return `/users/${npub}/relays`
}
export const toRelaySettings = (tag?: 'mailbox' | 'favorite-relays') => {
return '/relay-settings' + (tag ? '#' + tag : '')
}
export const toSettings = () => '/settings'
export const toWallet = () => '/wallet'
export const toRelaySettings = (tag?: 'mailbox' | 'favorite-relays') => {
return '/settings/relays' + (tag ? '#' + tag : '')
}
export const toWallet = () => '/settings/wallet'
export const toPostSettings = () => '/settings/posts'
export const toProfileEditor = () => '/profile-editor'
export const toRelay = (url: string) => `/relays/${encodeURIComponent(url)}`
export const toMuteList = () => '/mutes'

View File

@@ -41,7 +41,12 @@ export function normalizeHttpUrl(url: string): string {
}
export function simplifyUrl(url: string): string {
return url.replace('wss://', '').replace('ws://', '').replace(/\/$/, '')
return url
.replace('wss://', '')
.replace('ws://', '')
.replace('https://', '')
.replace('http://', '')
.replace(/\/$/, '')
}
export function isLocalNetworkUrl(urlString: string): boolean {