Take control over your live stream video by running it yourself. Streaming + chat out of the box.
HTML activitypubbroadcastingchatdecentralizedfederationfediversegolanghacktoberfesthlslivelivestreamowncastrtmpself-hostedstreaming-videovideo
refactor: declare format timestamp as variable for consistency
Ahmad Karlam81c9990d0779
diff --git a/webroot/js/components/chat/message.js b/webroot/js/components/chat/message.jsindex 317a9006a6..c575150888 100644--- a/webroot/js/components/chat/message.js+++ b/webroot/js/components/chat/message.js@@ -16,6 +16,7 @@ export default class Message extends Component {const { image, author, body, timestamp } = message;const formattedMessage = formatMessageText(body, username);const avatar = image || generateAvatar(author);+ const formattedTimestamp = formatTimestamp(timestamp);const authorColor = messageBubbleColorForString(author);const avatarBgColor = { backgroundColor: authorColor };@@ -35,7 +36,7 @@ export default class Message extends Component {</div><divclass="message-text text-gray-300 font-normal overflow-y-hidden"- title=${`Sent at ${formatTimestamp(timestamp)}`}+ title=${formattedTimestamp}dangerouslySetInnerHTML=${{ __html: formattedMessage }}diff --git a/webroot/js/utils/chat.js b/webroot/js/utils/chat.jsindex e09bbdd48a..638f3964cb 100644--- a/webroot/js/utils/chat.js+++ b/webroot/js/utils/chat.js@@ -284,9 +284,9 @@ export function formatTimestamp(sentAt) {let diffInDays = ((new Date()) - sentAt) / (24 * 3600 * 1000);if (diffInDays >= 1) {- return `${sentAt.toLocaleDateString('en-US', {dateStyle: 'medium'})} at ` ++ return `Sent at ${sentAt.toLocaleDateString('en-US', {dateStyle: 'medium'})} at ` +sentAt.toLocaleTimeString();}- return sentAt.toLocaleTimeString();+ return `Sent at ${sentAt.toLocaleTimeString()}`;}