mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-16 09:04:45 +01:00
Better default config
Resources update Try to actually show news on startup
This commit is contained in:
@@ -60,7 +60,10 @@ export default class NewsSection extends React.Component<IProps, IState> {
|
||||
|
||||
async showLatestCommits() {
|
||||
if (!this.state.commitList) {
|
||||
const response: string = await invoke('req_get', { url: 'https://api.grasscutter.io/cultivation/query' })
|
||||
// Just use official API
|
||||
const response: string = await invoke('req_get', {
|
||||
url: 'https://api.github.com/repos/Grasscutters/Grasscutter/commits',
|
||||
})
|
||||
let grasscutterApiResponse: GrasscutterAPIResponse | null = null
|
||||
|
||||
try {
|
||||
@@ -71,7 +74,7 @@ export default class NewsSection extends React.Component<IProps, IState> {
|
||||
|
||||
let commits: CommitResponse[]
|
||||
if (grasscutterApiResponse?.commits == null) {
|
||||
// If it didn't work, use official API
|
||||
// If it didn't work, try again anyways
|
||||
const response: string = await invoke('req_get', {
|
||||
url: 'https://api.github.com/repos/Grasscutters/Grasscutter/commits',
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user