Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

Commit b315041

Browse files
author
Jeff
committed
Releasing v0.4.2.
1 parent 2454546 commit b315041

File tree

5 files changed

+22
-11
lines changed

5 files changed

+22
-11
lines changed

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,30 @@
22

33
[![Build Status](https://travis-ci.com/pubnub/typescript-ref-app-team-chat.svg?token=ey6rVJnpqsBKpxXy2fYF&branch=master)](https://travis-ci.com/pubnub/typescript-ref-app-team-chat)
44

5-
This repository contains code from the Team Chat Reference App hosted on [PubNub Chat Docs Page](https://www.pubnub.com/docs/chat/quickstart#quickstart).
5+
This repository contains the code for the Team Chat Reference Application hosted on [PubNub Chat Docs Page](https://www.pubnub.com/docs/chat/quickstart#quickstart).
6+
7+
The application demonstrates how to build a chat application using:
8+
- PubNub
9+
- TypeScript
10+
- React
11+
- Redux
12+
13+
![alt text](team-chat-preview.png "Reference App")
614

715
## Requirements
816

917
* [Node.js](https://nodejs.org/en/)
10-
* [Gulp](https://gulpjs.com) - required to install project dependencies.
11-
12-
## Prerequisites
18+
* PubNub Account (Free)
1319

1420
### PubNub Account
1521

16-
If you don't already have an account, you can create one for free [here](https://dashboard.pubnub.com/).
22+
If you don't already have an account, you can [create one for free](https://dashboard.pubnub.com/).
1723

1824
1. Sign in to your PubNub [Admin Dashboard](https://dashboard.pubnub.com/), click Create New App for PubNub Chat and give your app a name.
1925

2026
1. Select your new app, then click its keyset.
2127

22-
1. Copy the Publish and Subscribe keys. You'll need these keys to include in this project.
28+
1. Locate the Publish and Subscribe keys. You'll need these keys to include in this project.
2329

2430
## Building the project
2531

@@ -46,6 +52,6 @@ Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
4652

4753
## Further Information
4854

49-
Visit the [PubNub Chat Docs](https://www.pubnub.com/docs/chat) page for more information on how to use the React and Redux SDKs to easily add in-app chat to your applications.
55+
Visit the [PubNub Chat Docs](https://www.pubnub.com/docs/chat) page for more information on how to use the React and Redux SDKs to add in-app chat to your applications.
5056

51-
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
57+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). Special thanks to Elvis Wolcott and Mark Erikson.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "team-chat",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"description": "Team Chat - A Reference Application for PubNub with Typescript, React and Redux",
55
"license": "MIT",
66
"private": true,

src/features/joinedConversations/leaveConversationCommand.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,18 @@ export const leaveConversation = (
1010
conversationId: string
1111
): ThunkAction<Promise<void>> => {
1212
return (dispatch, getState, context) => {
13+
if (conversationId === DEFAULT_CONVERSATION) {
14+
return Promise.resolve();
15+
}
1316
const done = dispatch(
1417
leaveSpaces({
1518
userId: userId,
1619
spaces: [{ id: conversationId }]
1720
})
1821
).then(() => {
19-
context.pubnub.api.unsubscribe(conversationId);
22+
context.pubnub.api.unsubscribe({
23+
channels: [conversationId]
24+
});
2025
dispatch(focusOnConversation(DEFAULT_CONVERSATION));
2126
});
2227

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export default (ts: string) => {
2-
const date = new Date(parseInt(ts) / 1000);
2+
const date = new Date(parseInt(ts) / 10000);
33
const minutes = date.getMinutes();
44
return `${date.getHours()}:${minutes > 9 ? minutes : "0" + minutes}`;
55
};

team-chat-preview.png

399 KB
Loading

0 commit comments

Comments
 (0)