File tree 1 file changed +6
-4
lines changed
www/src/features/about-modal/changelog
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 {
12
12
return typeof data === "object" && data !== null && "body" in data ;
13
13
}
14
14
15
- async function fetchChangelog ( ) {
15
+ async function getChangelog ( ) {
16
16
return fetch (
17
- `/ api/repos/${ release . owner } /${ release . repo } /releases/latest` ,
17
+ `https:// api.github.com /repos/${ release . owner } /${ release . repo } /releases/latest` ,
18
18
{
19
19
headers : {
20
20
Accept : "application/vnd.github.v3+json" ,
@@ -23,7 +23,9 @@ async function fetchChangelog() {
23
23
)
24
24
. then ( ( response ) => {
25
25
if ( ! 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
+ } ) ;
27
29
}
28
30
return response . json ( ) ;
29
31
} )
@@ -41,7 +43,7 @@ async function fetchChangelog() {
41
43
) ;
42
44
}
43
45
44
- const changelogAtom : Atom < Promise < string > > = atomWithCache ( fetchChangelog , {
46
+ const changelogAtom : Atom < Promise < string > > = atomWithCache ( getChangelog , {
45
47
shouldRemove ( createdAt ) {
46
48
return Date . now ( ) - createdAt > CACHE_TTL_S * 1000 ;
47
49
} ,
You can’t perform that action at this time.
0 commit comments