chore: reformat with 2 spaces

This commit is contained in:
Johannes Loher 2023-07-10 22:23:13 +02:00
parent d659e4bed9
commit 7670d7f808
No known key found for this signature in database
GPG key ID: 7CB0A9FB553DA045
1577 changed files with 70010 additions and 70042 deletions

View file

@ -6,14 +6,14 @@ const basicFonts = ["Wood Stamp"];
const variantFonts = ["Lora"];
export async function preloadFonts(): Promise<FontFace[][]> {
const fonts = [
...basicFonts.map((font) => `1rem ${font}`),
...variantFonts.flatMap((font) => [
`1rem ${font}`,
`bold 1rem ${font}`,
`italic 1rem ${font}`,
`bold italic 1rem ${font}`,
]),
];
return Promise.all(fonts.map((font) => document.fonts.load(font)));
const fonts = [
...basicFonts.map((font) => `1rem ${font}`),
...variantFonts.flatMap((font) => [
`1rem ${font}`,
`bold 1rem ${font}`,
`italic 1rem ${font}`,
`bold italic 1rem ${font}`,
]),
];
return Promise.all(fonts.map((font) => document.fonts.load(font)));
}

View file

@ -24,16 +24,16 @@ import { getNotificationsSafe } from "../utils/utils";
* @returns {NotificationFunction}
*/
function getNotificationFunction(type) {
return (message, { permanent = false, log = false } = {}) => {
if (ui.notifications) {
ui.notifications[type](message, { permanent });
if (log) {
logger[type](message);
}
} else {
logger[type](message);
}
};
return (message, { permanent = false, log = false } = {}) => {
if (ui.notifications) {
ui.notifications[type](message, { permanent });
if (log) {
logger[type](message);
}
} else {
logger[type](message);
}
};
}
/**
@ -42,20 +42,20 @@ function getNotificationFunction(type) {
* @param {NotificationOptions} [options={}]
*/
function notify(message, type, { permanent = false, log = false } = {}) {
const notifications = getNotificationsSafe();
if (notifications) {
notifications.notify(message, type, { permanent });
if (log) {
logger.getLoggingFunction(type)(message);
}
} else {
logger.getLoggingFunction(type)(message);
const notifications = getNotificationsSafe();
if (notifications) {
notifications.notify(message, type, { permanent });
if (log) {
logger.getLoggingFunction(type)(message);
}
} else {
logger.getLoggingFunction(type)(message);
}
}
export const notifications = Object.freeze({
info: getNotificationFunction("info"),
warn: getNotificationFunction("warn"),
error: getNotificationFunction("error"),
notify,
info: getNotificationFunction("info"),
warn: getNotificationFunction("warn"),
error: getNotificationFunction("error"),
notify,
});