File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
www/src/features/about-modal/changelog Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,9 @@ function isChangelogResponse(data: unknown): data is ChangelogResponse {
1212return typeof data === "object" && data !== null && "body" in data ;
1313}
1414
15- async function fetchChangelog ( ) {
15+ async function getChangelog ( ) {
1616return fetch (
17- `/ api/repos/${ release . owner } /${ release . repo } /releases/latest` ,
17+ `https:// api.github.com /repos/${ release . owner } /${ release . repo } /releases/latest` ,
1818{
1919headers : {
2020Accept : "application/vnd.github.v3+json" ,
@@ -23,7 +23,9 @@ async function fetchChangelog() {
2323)
2424. then ( ( response ) => {
2525if ( ! response . ok ) {
26- throw new Error ( "Network response was not ok" ) ;
26+ throw new Error ( "Network response was not ok" , {
27+ cause : response . status ,
28+ } ) ;
2729}
2830return response . json ( ) ;
2931} )
@@ -41,7 +43,7 @@ async function fetchChangelog() {
4143) ;
4244}
4345
44- const changelogAtom : Atom < Promise < string > > = atomWithCache ( fetchChangelog , {
46+ const changelogAtom : Atom < Promise < string > > = atomWithCache ( getChangelog , {
4547shouldRemove ( createdAt ) {
4648return Date . now ( ) - createdAt > CACHE_TTL_S * 1000 ;
4749} ,
You can’t perform that action at this time.
0 commit comments