-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:nmelhado/league-page into legends…
…-league
- Loading branch information
Showing
5 changed files
with
69 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,21 @@ | ||
{ | ||
"name": "legends-league", | ||
"version": "2.0.0", | ||
"name": "league-page", | ||
"version": "1.0.0", | ||
"homepage": "https://github.com/nmelhado/league-page#readme", | ||
"author": { | ||
"name" : "Nicholas Melhado", | ||
"email" : "[email protected]", | ||
"url" : "http://www.nmelhado.com/" | ||
}, | ||
"funding": { | ||
"type": "buy_me_a_coffee", | ||
"url": "https://www.buymeacoffee.com/nmelhado" | ||
}, | ||
"bugs": { | ||
"url" : "https://github.com/nmelhado/league-page/issues", | ||
"email" : "[email protected]" | ||
}, | ||
"license": "MIT", | ||
"engines": { | ||
"node": ">=14.0.0", | ||
"npm": ">=6.0.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
!!! DO NOT EDIT !!! | ||
This is used to check if there are any updates | ||
available for your copy of League Page | ||
*/ | ||
|
||
// Keep in sync with package.json | ||
export const version = "1.0.0"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {version} from '$lib/version'; | ||
|
||
export async function get() { | ||
const res = await fetch('https://league-page.nmelhado.com/api/checkVersion', {compress: true}) | ||
let needsUpdate = false; | ||
if(res.ok) { | ||
const globalVersion = await res.json(); | ||
console.log(`VERSION CHECK: global version: ${globalVersion}, local version: ${version}`); | ||
console.log(version); | ||
// If it reaches the global checkpoint and the versions do not match | ||
// set needsUpdate to true to display the update prompt | ||
needsUpdate = globalVersion != version; | ||
} | ||
|
||
return { | ||
status: 200, | ||
body: JSON.stringify(needsUpdate) | ||
}; | ||
} |
b19b0fb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: