Add action message type to chat. Closes #2226

This commit is contained in:
Gabe Kangas 2022-10-18 19:44:42 -07:00
parent fef0ca4587
commit 0c127a65ce
No known key found for this signature in database
GPG key ID: 9A56337728BC81EA

View file

@ -84,6 +84,7 @@ export function debounce(fn, time) {
let timeout; let timeout;
return function () { return function () {
// eslint-disable-next-line prefer-rest-params
const functionCall = () => fn.apply(this, arguments); const functionCall = () => fn.apply(this, arguments);
clearTimeout(timeout); clearTimeout(timeout);
@ -105,7 +106,7 @@ export function makeLastOnlineString(timestamp) {
const time = new Date(timestamp); const time = new Date(timestamp);
const comparisonDate = new Date(time).setHours(0, 0, 0, 0); const comparisonDate = new Date(time).setHours(0, 0, 0, 0);
if (comparisonDate == new Date().setHours(0, 0, 0, 0)) { if (comparisonDate === new Date().setHours(0, 0, 0, 0)) {
const atTime = time.toLocaleTimeString([], { const atTime = time.toLocaleTimeString([], {
hour: '2-digit', hour: '2-digit',
minute: '2-digit', minute: '2-digit',
@ -151,3 +152,14 @@ export function paginateArray(items, page, perPage) {
items: paginatedItems, items: paginatedItems,
}; };
} }
// Take a nested object of state metadata and merge it into
// a single flattened node.
export function mergeMeta(meta) {
return Object.keys(meta).reduce((acc, key) => {
const value = meta[key];
Object.assign(acc, value);
return acc;
}, {});
}