[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot]
2023-05-23 15:33:07 +00:00
parent 9d68107722
commit b0367c21f3
3 changed files with 21 additions and 21 deletions

View File

@@ -45,11 +45,11 @@ const ServerDashboard = (props) => {
adminAsc = (e) => e.sort((a) => (a.admin ? 1 : -1)),
dateDesc = (e) =>
e.sort((a, b) =>
new Date(a.last_activity) - new Date(b.last_activity) > 0 ? -1 : 1
new Date(a.last_activity) - new Date(b.last_activity) > 0 ? -1 : 1,
),
dateAsc = (e) =>
e.sort((a, b) =>
new Date(a.last_activity) - new Date(b.last_activity) > 0 ? 1 : -1
new Date(a.last_activity) - new Date(b.last_activity) > 0 ? 1 : -1,
),
runningAsc = (e) => e.sort((a) => (a.server == null ? -1 : 1)),
runningDesc = (e) => e.sort((a) => (a.server == null ? 1 : -1));
@@ -144,7 +144,7 @@ const ServerDashboard = (props) => {
dispatchPageUpdate(
data.items,
data._pagination,
name_filter
name_filter,
);
})
.catch(() => {
@@ -188,7 +188,7 @@ const ServerDashboard = (props) => {
dispatchPageUpdate(
data.items,
data._pagination,
name_filter
name_filter,
);
})
.catch(() => {
@@ -228,7 +228,7 @@ const ServerDashboard = (props) => {
dispatchPageUpdate(
data.items,
data._pagination,
name_filter
name_filter,
);
})
.catch(() => {
@@ -536,7 +536,7 @@ const ServerDashboard = (props) => {
failedServers.length > 1 ? "servers" : "server"
}. ${
failedServers.length > 1 ? "Are they " : "Is it "
} already running?`
} already running?`,
);
}
return res;
@@ -547,11 +547,11 @@ const ServerDashboard = (props) => {
dispatchPageUpdate(
data.items,
data._pagination,
name_filter
name_filter,
);
})
.catch(() =>
setErrorAlert(`Failed to update users list.`)
setErrorAlert(`Failed to update users list.`),
);
return res;
})
@@ -576,7 +576,7 @@ const ServerDashboard = (props) => {
failedServers.length > 1 ? "servers" : "server"
}. ${
failedServers.length > 1 ? "Are they " : "Is it "
} already stopped?`
} already stopped?`,
);
}
return res;
@@ -587,11 +587,11 @@ const ServerDashboard = (props) => {
dispatchPageUpdate(
data.items,
data._pagination,
name_filter
name_filter,
);
})
.catch(() =>
setErrorAlert(`Failed to update users list.`)
setErrorAlert(`Failed to update users list.`),
);
return res;
})

View File

@@ -403,7 +403,7 @@ test("Shows a UI error dialogue when start all servers fails", async () => {
/>
</Switch>
</HashRouter>
</Provider>
</Provider>,
);
});
@@ -437,7 +437,7 @@ test("Shows a UI error dialogue when stop all servers fails", async () => {
/>
</Switch>
</HashRouter>
</Provider>
</Provider>,
);
});
@@ -471,7 +471,7 @@ test("Shows a UI error dialogue when start user server fails", async () => {
/>
</Switch>
</HashRouter>
</Provider>
</Provider>,
);
});
@@ -506,7 +506,7 @@ test("Shows a UI error dialogue when start user server returns an improper statu
/>
</Switch>
</HashRouter>
</Provider>
</Provider>,
);
});
@@ -541,7 +541,7 @@ test("Shows a UI error dialogue when stop user servers fails", async () => {
/>
</Switch>
</HashRouter>
</Provider>
</Provider>,
);
});
@@ -575,7 +575,7 @@ test("Shows a UI error dialogue when stop user server returns an improper status
/>
</Switch>
</HashRouter>
</Provider>
</Provider>,
);
});
@@ -621,7 +621,7 @@ test("Search for user calls updateUsers with name filter", async () => {
/>
</Switch>
</HashRouter>
</Provider>
</Provider>,
);
});

View File

@@ -7,11 +7,11 @@ const withAPI = withProps(() => ({
`/users?include_stopped_servers&offset=${offset}&limit=${limit}&name_filter=${
name_filter || ""
}`,
"GET"
"GET",
).then((data) => data.json()),
updateGroups: (offset, limit) =>
jhapiRequest(`/groups?offset=${offset}&limit=${limit}`, "GET").then(
(data) => data.json()
(data) => data.json(),
),
shutdownHub: () => jhapiRequest("/shutdown", "POST"),
startServer: (name, serverName = "") =>
@@ -22,7 +22,7 @@ const withAPI = withProps(() => ({
jhapiRequest(
"/users/" + name + "/servers/" + (serverName || ""),
"DELETE",
{ remove: true }
{ remove: true },
),
startAll: (names) =>
names.map((e) => jhapiRequest("/users/" + e + "/server", "POST")),