Add ShareBtn component and update SettingsOptionLayout
This commit is contained in:
10
src/utils/verify-page-share.ts
Normal file
10
src/utils/verify-page-share.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { cleanUrl } from "~libs/clean-url"
|
||||
|
||||
export const verifyPageShareURL = async (url: string) => {
|
||||
const res = await fetch(`${cleanUrl(url)}/api/v1/ping`)
|
||||
if (!res.ok) {
|
||||
throw new Error("Unable to verify page share")
|
||||
}
|
||||
const data = await res.text()
|
||||
return data === "pong"
|
||||
}
|
||||
Reference in New Issue
Block a user