mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2026-01-07 00:04:29 +01:00
use kobalte dialog for modal instead
This commit is contained in:
13
src/utils/getHostname.ts
Normal file
13
src/utils/getHostname.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
export default function getHostname(url: string): string {
|
||||
// Check if the URL begins with "ws://" or "wss://"
|
||||
if (url.startsWith("ws://")) {
|
||||
// If it does, remove "ws://" from the URL
|
||||
url = url.slice(5);
|
||||
} else if (url.startsWith("wss://")) {
|
||||
// If it begins with "wss://", remove "wss://" from the URL
|
||||
url = url.slice(6);
|
||||
}
|
||||
|
||||
// Return the resulting URL
|
||||
return url;
|
||||
}
|
||||
Reference in New Issue
Block a user