New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@empirica/chat

Package Overview
Dependencies
Maintainers
5
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@empirica/chat - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

src/ErrorBoundary.js

2

package.json
{
"name": "@empirica/chat",
"version": "1.1.2",
"version": "1.1.3",
"description": "React component of a chat lobby for the Empirica experiment platform.",

@@ -5,0 +5,0 @@ "main": "./build/index.js",

@@ -6,2 +6,3 @@ import PropTypes from "prop-types";

import Messages from "./Messages";
import ErrorBoundary from "./ErrorBoundary";

@@ -47,15 +48,25 @@ export default class Chat extends React.PureComponent {

return (
<div className="empirica-chat-container">
{isChatOpen ? (
<div className="empirica-chat-open">
<HeaderComp {...common} onClick={this.onClick} />
<div className="chat">
<Messages {...common} messageComp={MessageComp} filter={filter} />
<FooterComp {...common} timeStamp={timeStamp} onNewMessage={this.onNewMessage} />
<ErrorBoundary>
<div className="empirica-chat-container">
{isChatOpen ? (
<div className="empirica-chat-open">
<HeaderComp {...common} onClick={this.onClick} />
<div className="chat">
<Messages
{...common}
messageComp={MessageComp}
filter={filter}
/>
<FooterComp
{...common}
timeStamp={timeStamp}
onNewMessage={this.onNewMessage}
/>
</div>
</div>
</div>
) : (
<ClosedComp {...common} onClick={this.onClick} />
)}
</div>
) : (
<ClosedComp {...common} onClick={this.onClick} />
)}
</div>
</ErrorBoundary>
);

@@ -62,0 +73,0 @@ }

import PropTypes from "prop-types";
import React from "react";
import Chat from "./Chat";
import GameLobby from "./GameLobby";
import ErrorBoundary from "./ErrorBoundary";

@@ -9,6 +11,6 @@ export default class LobbyChat extends React.PureComponent {

return (
<div>
<ErrorBoundary>
<GameLobby {...this.props} />
<Chat {...this.props} />
</div>
<Chat {...this.props} scope={this.props.game} />
</ErrorBoundary>
);

@@ -21,3 +23,3 @@ }

game: PropTypes.object.isRequired,
treatment: PropTypes.object.isRequired
treatment: PropTypes.object.isRequired,
};

@@ -32,3 +32,6 @@ import PropTypes from "prop-types";

if (this.messagesEl.current !== null && currentMessages.length > prevMessages.length) {
if (
this.messagesEl.current !== null &&
currentMessages.length > prevMessages.length
) {
this.messagesEl.current.scrollTop = this.messagesEl.current.scrollHeight;

@@ -43,3 +46,5 @@ }

<div className="messages" ref={this.messagesEl}>
{messages.length === 0 ? <div className="empty">No messages yet...</div> : null}
{messages.length === 0 ? (
<div className="empty">No messages yet...</div>
) : null}
{messages.map((message, i) => {

@@ -46,0 +51,0 @@ return <MessageComp key={i} message={message} player={player} />;

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc