Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
webdev03 committed Oct 4, 2023
1 parent a648f7d commit 949ee3b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/classes/CloudConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class CloudConnection extends events.EventEmitter {
const obj = JSON.parse(message || '{"method": "err"}');
if (obj.method == "set") {
this.emit("set", { name: obj.name, value: obj.value });
this.variables.set(obj.name, obj.value)
this.variables.set(obj.name, obj.value);
}
}
});
Expand Down Expand Up @@ -93,7 +93,7 @@ class CloudConnection extends events.EventEmitter {
const varname = variable.startsWith("☁ ")
? variable.substring(2)
: variable;
this.variables.set(`☁ ${varname}`, value.toString())
this.variables.set(`☁ ${varname}`, value.toString());
if (!this.open) {
this.queue.push({
user: this.session.sessionJSON.user.username,
Expand Down
9 changes: 5 additions & 4 deletions src/classes/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,9 @@ class Project {
}
}
);
if(!request.ok) throw Error(`Request failed with status ${request.status}`);
return Number((await request.json())['id']);
if (!request.ok)
throw Error(`Request failed with status ${request.status}`);
return Number((await request.json())["id"]);
}

/**
Expand Down Expand Up @@ -348,7 +349,7 @@ class Project {
);
if (!request.ok)
throw Error(`Request failed with status ${request.status}`);
return (await request.json())['userLove'] as boolean;
return (await request.json())["userLove"] as boolean;
}

/**
Expand All @@ -371,7 +372,7 @@ class Project {
);
if (!request.ok)
throw Error(`Request failed with status ${request.status}`);
return (await request.json())['userFavorite'] as boolean;
return (await request.json())["userFavorite"] as boolean;
}

/**
Expand Down
5 changes: 3 additions & 2 deletions src/classes/Studio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,9 @@ class Studio {
}
}
);
if(!request.ok) throw Error(`Request failed with status ${request.status}`);
return Number((await request.json())['id']);
if (!request.ok)
throw Error(`Request failed with status ${request.status}`);
return Number((await request.json())["id"]);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/classes/forums/Forum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Forum {
}

async createTopic(title: string, body: string) {
if(!this.id) throw Error("You need to add a forum id");
if (!this.id) throw Error("You need to add a forum id");
const form = new FormData();
form.append("csrfmiddlewaretoken", this.session.csrfToken);
form.append("name", title);
Expand All @@ -88,7 +88,7 @@ class Forum {
"Cache-Control": "no-cache",
"Content-Type": encoder.contentType,
Origin: "https://scratch.mit.edu",
Referer: `https://scratch.mit.edu/discuss/${this.id}/topic/add`,
Referer: `https://scratch.mit.edu/discuss/${this.id}/topic/add`
}
}
);
Expand Down

0 comments on commit 949ee3b

Please sign in to comment.