chore: reformat with 2 spaces
This commit is contained in:
parent
d659e4bed9
commit
7670d7f808
1577 changed files with 70010 additions and 70042 deletions
|
@ -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)));
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue