mirror of
https://github.com/owncast/owncast.git
synced 2024-11-25 22:31:09 +03:00
Add action message type to chat. Closes #2226
This commit is contained in:
parent
fef0ca4587
commit
0c127a65ce
1 changed files with 13 additions and 1 deletions
|
@ -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;
|
||||||
|
}, {});
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue