Skip to content

Commit

Permalink
fix: added test for chat preview search list
Browse files Browse the repository at this point in the history
  • Loading branch information
mishramonalisha76 committed May 16, 2024
1 parent db02592 commit 19dd8a1
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { ChatPreviewSearchList } from '@pushprotocol/uiweb';

const ChatPreviewSearchListTest = () => {
return (
<>
<div
style={{
background: '#ffeded',
border: '1px solid rgb(226,8,128)',
height: '28.5vh',
}}
>
<ChatPreviewSearchList searchParamter="0xFA3F8E79fb9B03e7a04295594785b91588Aa4DC8" />
</div>
</>
);
};

export default ChatPreviewSearchListTest;
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const ChatUITest = () => {
CHAT BUBBLE
</Link>
<Link to="/ChatViewList" className="nav-button">
CHAT VIEW LIST
CHAT VIEW LIST
</Link>
<Link to="/ChatView" className="nav-button">
CHAT VIEW
Expand All @@ -44,6 +44,9 @@ const ChatUITest = () => {
<Link to="/ChatPreviewList" className="nav-button">
CHAT PREVIEW LIST
</Link>
<Link to="/ChatPreviewSearchList" className="nav-button">
CHAT PREVIEW SEARCH LIST
</Link>
<Link to="/userProfile" className="nav-button">
USER PROFILE COMPONENT
</Link>
Expand Down
5 changes: 5 additions & 0 deletions packages/examples/sdk-frontend-react/src/app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ import { SubscriptionManagerTest } from './widget/SubscriptionManagerTest';
import Widget from './widget/Widget';
// import { SubscriptionManagerTest } from './widget/SubscriptionManagerTest';
import { UserProfileTest } from './ChatUITest/UserProfileTest';
import ChatPreviewSearchListTest from './ChatUITest/ChatPreviewSearchList';

window.Buffer = window.Buffer || Buffer;

Expand Down Expand Up @@ -656,6 +657,10 @@ export function App() {
path="ChatPreview"
element={<ChatPreviewTest />}
/>
<Route
path="ChatPreviewSearchList"
element={<ChatPreviewSearchListTest />}
/>
<Route
path="ChatPreviewList"
element={<ChatPreviewListTest />}
Expand Down
2 changes: 1 addition & 1 deletion packages/uiweb/src/lib/dataProviders/ChatDataProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const ChatUIProvider = ({

console.debug(`UIWeb::ChatDataProvider::user changed - ${new Date().toISOString()}`, user);

if (!user.readmode()) {
if (!user?.readmode()) {
await initStream(user);
}

Expand Down

0 comments on commit 19dd8a1

Please sign in to comment.