File tree 1 file changed +10
-8
lines changed
1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -80,17 +80,11 @@ export async function reloadCache() {
80
80
https://github.com/github-tools/github/issues/593
81
81
https://github.com/github-tools/github/issues/578
82
82
*/
83
- const { data } = await repository . _requestAllPages (
83
+ let { data } = await repository . _requestAllPages (
84
84
`/repos/${ repository . __fullname } /pulls?state=all`
85
85
)
86
86
87
- if ( Array . isArray ( data ) && data . length ) {
88
- await writeFile ( PATH_CACHE_FILE , JSON . stringify ( data ) )
89
- }
90
-
91
- console . info ( `Cached ${ data . length } RFCs to disc!` )
92
-
93
- rfcs = data . map ( rfc => {
87
+ data = data . map ( rfc => {
94
88
/*
95
89
WORKAROUND: For some stupid reason, Discord mobile doesn't like CR+LF here.
96
90
SEE: https://github.com/Elfayer/vue-land-bot/issues/58
@@ -102,6 +96,14 @@ export async function reloadCache() {
102
96
return rfc
103
97
} )
104
98
99
+ if ( Array . isArray ( data ) && data . length ) {
100
+ await writeFile ( PATH_CACHE_FILE , JSON . stringify ( data ) )
101
+ }
102
+
103
+ console . info ( `Cached ${ data . length } RFCs to disc!` )
104
+
105
+ rfcs = data
106
+
105
107
return rfcs
106
108
} catch ( e ) {
107
109
console . error ( e )
You can’t perform that action at this time.
0 commit comments