mirror of
https://github.com/pompurin404/mihomo-party.git
synced 2024-11-16 03:32:17 +08:00
fix gist url
This commit is contained in:
parent
4c238e1bdf
commit
784db36c48
|
@ -5,7 +5,7 @@ import { getRuntimeConfigStr } from '../core/factory'
|
|||
interface GistInfo {
|
||||
id: string
|
||||
description: string
|
||||
files: Record<string, { filename: string; raw_url: string }>
|
||||
html_url: string
|
||||
}
|
||||
|
||||
async function listGists(token: string): Promise<GistInfo[]> {
|
||||
|
@ -78,7 +78,7 @@ export async function getGistUrl(): Promise<string> {
|
|||
const gists = await listGists(githubToken)
|
||||
const gist = gists.find((gist) => gist.description === 'Auto Synced Mihomo Party Runtime Config')
|
||||
if (gist) {
|
||||
return gist.files['mihomo-party.yaml'].raw_url
|
||||
return gist.html_url
|
||||
} else {
|
||||
throw new Error('Gist not found')
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ const MihomoConfig: React.FC = () => {
|
|||
try {
|
||||
const url = await getGistUrl()
|
||||
if (url !== '') {
|
||||
await navigator.clipboard.writeText(url)
|
||||
await navigator.clipboard.writeText(`${url}/raw/mihomo-party.yaml`)
|
||||
}
|
||||
} catch (e) {
|
||||
alert(e)
|
||||
|
|
Loading…
Reference in New Issue
Block a user