chore: 🎨 format

This commit is contained in:
ThatOneCalculator 2023-04-01 21:10:31 -07:00
parent 2469198bb1
commit e9b45260b5
No known key found for this signature in database
GPG key ID: 8703CACD01000000
8 changed files with 25 additions and 18 deletions

View file

@ -266,10 +266,8 @@ export const NoteRepository = db.getRepository(Note).extend({
if (packed.user.isCat && packed.text) {
const tokens = packed.text ? mfm.parse(packed.text) : [];
function nyaizeNode(node: mfm.MfmNode) {
if (node.type === "quote")
return;
if (node.type === "text")
node.props.text = nyaize(node.props.text);
if (node.type === "quote") return;
if (node.type === "text") node.props.text = nyaize(node.props.text);
if (node.children) {
for (const child of node.children) {
@ -278,8 +276,7 @@ export const NoteRepository = db.getRepository(Note).extend({
}
}
for (const node of tokens)
nyaizeNode(node);
for (const node of tokens) nyaizeNode(node);
packed.text = mfm.toString(tokens);
}

View file

@ -57,8 +57,7 @@ export default class extends Channel {
// Remove not typing users
for (const [userId, date] of Object.entries(this.typers)) {
if (now.getTime() - date.getTime() > 5000)
this.typers.delete(userId);
if (now.getTime() - date.getTime() > 5000) this.typers.delete(userId);
}
const userIds = Array.from(this.typers.keys());

View file

@ -108,8 +108,7 @@ export default class extends Channel {
// Remove not typing users
for (const [userId, date] of this.typers.entries()) {
if (now.getTime() - date.getTime() > 5000)
this.typers.delete(userId);
if (now.getTime() - date.getTime() > 5000) this.typers.delete(userId);
}
const userIds = Array.from(this.typers.keys());

View file

@ -47,10 +47,10 @@ window.onload = async () => {
const el = document.createElement("div");
const header = document.createElement("header");
const name = document.createElement("p");
const avatar = document.createElement("img")
const avatar = document.createElement("img");
name.textContent = `${note.user.name} @${note.user.username}`;
avatar.src = note.user.avatarUrl;
avatar.style = 'height: 40px'
avatar.style = "height: 40px";
const text = document.createElement("div");
text.textContent = `${note.text}`;
el.appendChild(header);
@ -63,7 +63,7 @@ window.onload = async () => {
for (const file of note.files) {
const img = document.createElement("img");
img.src = file.properties.thumbnailUrl;
el.appendChild(img)
el.appendChild(img);
}
}
tl.appendChild(el);

View file

@ -556,7 +556,11 @@ export default abstract class Chart<T extends Schema> {
// bake unique count
for (const [k, v] of Object.entries(finalDiffs)) {
if (this.schema[k].uniqueIncrement && Array.isArray(v) && v.length > 0) {
if (
this.schema[k].uniqueIncrement &&
Array.isArray(v) &&
v.length > 0
) {
const name = (columnPrefix +
k.replaceAll(".", columnDot)) as keyof Columns<T>;
const tempColumnName = (uniqueTempColumnPrefix +
@ -660,7 +664,7 @@ export default abstract class Chart<T extends Schema> {
const startTime = Date.now();
await Promise.all(
groups.map((group) =>
groups.map((group) =>
limit(() =>
Promise.all([
this.claimCurrentLog(group, "hour"),

View file

@ -67,6 +67,6 @@ export function openHelpMenu_(ev: MouseEvent) {
],
},
],
ev.currentTarget ?? ev.target
ev.currentTarget ?? ev.target,
);
}

View file

@ -30,7 +30,8 @@ export function play(type: string) {
export function playFile(file: string, volume: number) {
const masterVolume = ColdDeviceStorage.get("sound_masterVolume");
if (masterVolume === 0 || volume === 0 || file.toLowerCase().includes("none")) return;
if (masterVolume === 0 || volume === 0 || file.toLowerCase().includes("none"))
return;
const audio = setVolume(getAudio(file), volume);
audio.play();

View file

@ -90,7 +90,14 @@ type OuterMenuItem =
| MenuButtonMultipleIcons
| MenuParent;
type OuterPromiseMenuItem = Promise<
MenuLabel | MenuLink | MenuA | MenuUser | MenuSwitch | MenuButton | MenuButtonMultipleIcons | MenuParent
| MenuLabel
| MenuLink
| MenuA
| MenuUser
| MenuSwitch
| MenuButton
| MenuButtonMultipleIcons
| MenuParent
>;
export type MenuItem = OuterMenuItem | OuterPromiseMenuItem;
export type InnerMenuItem =