4 Commits
1.0.5 ... 1.0.8

Author SHA1 Message Date
d04bd6a437 HotFix
All checks were successful
Setup testing environment and test the code / build (push) Successful in 57s
Publish to NPM / build-and-publish (release) Successful in 33s
2026-04-09 11:18:47 +02:00
0e553767b6 HotFix
Some checks failed
Publish to NPM / build-and-publish (release) Has been cancelled
Setup testing environment and test the code / build (push) Failing after 1m1s
2026-04-09 11:16:45 +02:00
b7af5497a4 Fix DM WebSocket
Some checks failed
Setup testing environment and test the code / build (push) Failing after 1m22s
Publish to NPM / build-and-publish (release) Successful in 30s
2026-04-09 11:12:41 +02:00
1cd629e3c1 loadSessions hotfix
All checks were successful
Setup testing environment and test the code / build (push) Successful in 1m20s
Publish to NPM / build-and-publish (release) Successful in 27s
2026-04-08 19:18:06 +02:00
4 changed files with 10 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@chatenium/chatenium-sdk",
"version": "1.0.5",
"version": "1.0.8",
"description": "A library for interacting with the Chatenium API",
"type": "module",
"main": "dist/index.js",

View File

@@ -28,4 +28,8 @@ export const dmHandlers = [
message: body.message,
})
}),
http.post('*/v2/chat/dm/joinWebSocketRoom', async () => {
return HttpResponse.json()
}),
]

View File

@@ -44,6 +44,7 @@ export class DMService {
private onNewConnId(newConnId: string) {
console.log("NetworkService: New connection id")
this.client.defaults.headers["X-WS-ID"] = newConnId;
this.joinWebSocketRoom().then()
}
/**
@@ -244,7 +245,7 @@ export class DMService {
*/
async joinWebSocketRoom(): Promise<void> {
try {
const resp = await this.client.patch("chat/dm/joinWebSocketRoom", <JoinWsRoomReq>{
await this.client.post("v2/chat/dm/joinWebSocketRoom", <JoinWsRoomReq>{
chatid: this.chatid,
userid: this.userid,
connId: WebSocketHandler.getInstance().connId,

View File

@@ -36,8 +36,9 @@ export class SessionManager {
async loadSessions(): Promise<Session[]> {
const tokens = await this.keyring.getAll()
const sessions: Session[] = []
for (const token of tokens) {
const userData = await this.database.get("sessions", token.split(".")[0])
for (const tokenKey of tokens) {
const token = await this.keyring.get(tokenKey)
const userData = await this.database.get("sessions", tokenKey)
if (userData) {
sessions.push({
token: token,