mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-14 16:14:48 +01:00
Linting
This commit is contained in:
@@ -6,7 +6,8 @@ pub struct Release {
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn get_latest_release() -> Release {
|
||||
let url = "https://api.github.com/repos/Grasscutters/Cultivation/releases/latest";
|
||||
// NotThorny edition requests to repo so as to avoid update spam from official repo -alpha version diff.
|
||||
let url = "https://api.github.com/repos/NotThorny/Cultivation/releases/latest";
|
||||
let client = reqwest::Client::new();
|
||||
let response = client
|
||||
.get(url)
|
||||
|
||||
@@ -35,7 +35,7 @@ const pages = [
|
||||
{
|
||||
name: 1,
|
||||
title: '>',
|
||||
}
|
||||
},
|
||||
]
|
||||
|
||||
const headers = [
|
||||
@@ -127,8 +127,8 @@ export class Mods extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
async setPage(value: number) {
|
||||
const current = this.state.page;
|
||||
if (current + value == 0) return;
|
||||
const current = this.state.page
|
||||
if (current + value == 0) return
|
||||
this.setState(
|
||||
{
|
||||
page: current + value,
|
||||
@@ -190,7 +190,12 @@ export class Mods extends React.Component<IProps, IState> {
|
||||
|
||||
<ModPages onClick={this.setPage} headers={pages} defaultHeader={1} />
|
||||
|
||||
<ModList key={`${this.state.category}_${this.state.page}`} mode={this.state.category} addDownload={this.addDownload} page={this.state.page} />
|
||||
<ModList
|
||||
key={`${this.state.category}_${this.state.page}`}
|
||||
mode={this.state.category}
|
||||
addDownload={this.addDownload}
|
||||
page={this.state.page}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ export class ModPages extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
setSelected(value: number) {
|
||||
const current = this.state.selected;
|
||||
if (current + value == 0) return;
|
||||
const current = this.state.selected
|
||||
if (current + value == 0) return
|
||||
this.setState({
|
||||
selected: current + value,
|
||||
})
|
||||
|
||||
@@ -119,18 +119,15 @@ interface ModDownload {
|
||||
|
||||
export async function getMods(mode: string, page: number) {
|
||||
let modList: GamebananaResponse[] = []
|
||||
let hadMods = true
|
||||
|
||||
const resp = JSON.parse(
|
||||
await invoke('list_submissions', {
|
||||
mode,
|
||||
page: '' + page,
|
||||
})
|
||||
)
|
||||
const resp = JSON.parse(
|
||||
await invoke('list_submissions', {
|
||||
mode,
|
||||
page: '' + page,
|
||||
})
|
||||
)
|
||||
|
||||
if (resp.length === 0) hadMods = false
|
||||
|
||||
modList = [...modList, ...resp]
|
||||
modList = [...modList, ...resp]
|
||||
|
||||
return formatGamebananaData(modList)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user