mirror of
https://github.com/owncast/owncast.git
synced 2025-11-02 03:54:54 +08:00
add news feed (#99)
* add news feed * Prettified Code! Co-authored-by: gingervitis <gingervitis@users.noreply.github.com>
This commit is contained in:
@ -116,9 +116,9 @@ export async function fetchData(url: string, options?: FetchOptions) {
|
||||
return {};
|
||||
}
|
||||
|
||||
export async function getGithubRelease() {
|
||||
export async function fetchExternalData(url: string) {
|
||||
try {
|
||||
const response = await fetch(GITHUB_RELEASE_URL);
|
||||
const response = await fetch(url);
|
||||
if (!response.ok) {
|
||||
const message = `An error has occured: ${response.status}`;
|
||||
throw new Error(message);
|
||||
@ -131,6 +131,10 @@ export async function getGithubRelease() {
|
||||
return {};
|
||||
}
|
||||
|
||||
export async function getGithubRelease() {
|
||||
return fetchExternalData(GITHUB_RELEASE_URL);
|
||||
}
|
||||
|
||||
// Stolen from https://gist.github.com/prenagha/98bbb03e27163bc2f5e4
|
||||
const VPAT = /^\d+(\.\d+){0,2}$/;
|
||||
function upToDate(local, remote) {
|
||||
|
||||
Reference in New Issue
Block a user