chore: 🎨 format
This commit is contained in:
parent
2469198bb1
commit
e9b45260b5
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 +
|
||||
|
|
|
@ -67,6 +67,6 @@ export function openHelpMenu_(ev: MouseEvent) {
|
|||
],
|
||||
},
|
||||
],
|
||||
ev.currentTarget ?? ev.target
|
||||
ev.currentTarget ?? ev.target,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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 =
|
||||
|
|
Loading…
Reference in New Issue