Skip to content

Commit a8f0e9a

Browse files
Merge branch 'main' of https://github.com/codeboltai/codeboltjs into main
2 parents bc55e2b + 9f752c1 commit a8f0e9a

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

.github/workflows/publish-to-npm.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Publish Package to npmjs
22
on:
33
release:
44
types: [published]
5+
workflow_dispatch:
56
jobs:
67
build:
78
runs-on: ubuntu-latest

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/modules/chat.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ let eventEmitter= new CustomEventEmitter()
1515
*/
1616
const cbchat = {
1717

18-
1918
/**
2019
* Retrieves the chat history from the server.
2120
* @returns {Promise<ChatMessage[]>} A promise that resolves with an array of ChatMessage objects representing the chat history.
@@ -35,8 +34,8 @@ const cbchat = {
3534
},
3635

3736
/**
38-
* @method setupMessageListener
39-
* @description Sets up a listener for incoming WebSocket messages.
37+
* Sets up a listener for incoming WebSocket messages and emits a custom event when a message is received.
38+
* @returns {EventEmitter} The event emitter used for emitting custom events.
4039
*/
4140
userMessageListener: () => {
4241
if (!cbws.getWebsocket) return;
@@ -85,7 +84,7 @@ const cbchat = {
8584
* Notifies the server that a process has started and sets up an event listener for stopProcessClicked events.
8685
* @returns An object containing the event emitter and a stopProcess method.
8786
*/
88-
processStarted() {
87+
processStarted: () => {
8988
// Send the process started message
9089
cbws.getWebsocket.send(JSON.stringify({
9190
"type": "processStarted"
@@ -113,6 +112,10 @@ const cbchat = {
113112
}
114113
};
115114
},
115+
/**
116+
* Stops the ongoing process.
117+
* Sends a specific message to the server to stop the process.
118+
*/
116119
stopProcess: () => {
117120
// Implement the logic to stop the process here
118121
console.log("Stopping process...");

0 commit comments

Comments
 (0)