Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Add action message type to chat. Closes #2226

Gabe Kangas36ac2eb94b4c
diff --git a/web/utils/helpers.js b/web/utils/helpers.js
index fc675d14b1..d6354139c8 100644
--- a/web/utils/helpers.js
+++ b/web/utils/helpers.js
@@ -84,6 +84,7 @@ export function debounce(fn, time) {
let timeout;
return function () {
+ // eslint-disable-next-line prefer-rest-params
const functionCall = () => fn.apply(this, arguments);
clearTimeout(timeout);
@@ -105,7 +106,7 @@ export function makeLastOnlineString(timestamp) {
const time = new Date(timestamp);
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([], {
hour: '2-digit',
minute: '2-digit',
@@ -151,3 +152,14 @@ export function paginateArray(items, page, perPage) {
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;
+ }, {});
+}