Web app: implement markdown support
This commit is contained in:
@@ -55,6 +55,15 @@ class Prefs {
|
||||
async setTheme(mode) {
|
||||
await this.db.prefs.put({ key: "theme", value: mode });
|
||||
}
|
||||
|
||||
async markdownAlwaysEnabled() {
|
||||
const record = await this.db.prefs.get("markdownAlwaysEnabled");
|
||||
return record?.value ?? false;
|
||||
}
|
||||
|
||||
async setMarkdownAlwaysEnabled(enabled) {
|
||||
await this.db.prefs.put({ key: "markdownAlwaysEnabled", value: enabled });
|
||||
}
|
||||
}
|
||||
|
||||
const prefs = new Prefs(db());
|
||||
|
||||
@@ -89,15 +89,15 @@ export const maybeWithAuth = (headers, user) => {
|
||||
return headers;
|
||||
};
|
||||
|
||||
export const maybeAppendActionErrors = (message, notification) => {
|
||||
export const maybeActionErrors = (notification) => {
|
||||
const actionErrors = (notification.actions ?? [])
|
||||
.map((action) => action.error)
|
||||
.filter((action) => !!action)
|
||||
.join("\n");
|
||||
if (actionErrors.length === 0) {
|
||||
return message;
|
||||
return undefined;
|
||||
}
|
||||
return `${message}\n\n${actionErrors}`;
|
||||
return actionErrors;
|
||||
};
|
||||
|
||||
export const shuffle = (arr) => {
|
||||
|
||||
Reference in New Issue
Block a user