mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 15:43:13 +09:00
Fix code style errors
Remove extra whitespace, use more consistent spacing, add missing semicolons, using dangling commas, break up long lines, consistent multiline operator placement, add missing JSDoc strings and so on.
This commit is contained in:
1 parent
97e05c0610
commit
7314dc99c8
71 files changed
+403
-290
No files matched your search
@@ -16,8 +16,9 @@ export function useHost(id: number): [ HostState, () => void ] {
|
||||
|
||||
function updateHost() {
|
||||
// XXX optimize by requesting only the host in question
|
||||
control.send(new lib.HostListRequest())
|
||||
.then((hosts: lib.HostDetails[]) => {
|
||||
control.send(
|
||||
new lib.HostListRequest()
|
||||
).then((hosts: lib.HostDetails[]) => {
|
||||
let match = hosts.find(i => i.id === id);
|
||||
if (!match) {
|
||||
setHost({ missing: true });
|
||||
@@ -35,7 +36,7 @@ export function useHost(id: number): [ HostState, () => void ] {
|
||||
updateHost();
|
||||
|
||||
function updateHandler(newHost: lib.HostDetails) {
|
||||
setHost({ ...newHost, loading:false, missing:false, present:true });
|
||||
setHost({ ...newHost, loading: false, missing: false, present: true });
|
||||
}
|
||||
|
||||
control.hostUpdate.subscribeToChannel(id, updateHandler);
|
||||
@@ -52,8 +53,9 @@ export function useHostList() {
|
||||
let [hostList, setHostList] = useState<lib.HostDetails[]>([]);
|
||||
|
||||
function updateHostList() {
|
||||
control.send(new lib.HostListRequest())
|
||||
.then((hosts: lib.HostDetails[]) => {
|
||||
control.send(
|
||||
new lib.HostListRequest()
|
||||
).then((hosts: lib.HostDetails[]) => {
|
||||
setHostList(hosts);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user