(event)
| 38 | * @param {Event} [event] |
| 39 | */ |
| 40 | export function setLogLevelFromRoute(event) { |
| 41 | if (location.hash.startsWith('#converse?loglevel=')) { |
| 42 | event?.preventDefault(); |
| 43 | const level = location.hash.split('=').pop(); |
| 44 | if (Object.keys(LEVELS).includes(level)) { |
| 45 | log.setLogLevel(/** @type {keyof LEVELS} */ (level)); |
| 46 | } else { |
| 47 | log.error(`Could not set loglevel of ${level}`); |
| 48 | } |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | export function isEmptyMessage(attrs) { |
| 53 | if (attrs instanceof Model) { |
no test coverage detected