fishpi 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/src/chatroom.js +6 -13
- package/package.json +1 -1
package/lib/src/chatroom.js
CHANGED
|
@@ -402,8 +402,8 @@ var ChatRoom = /** @class */ (function () {
|
|
|
402
402
|
}, 1000 * 60 * 3);
|
|
403
403
|
};
|
|
404
404
|
this._rws.onmessage = function (e) { return __awaiter(_this, void 0, void 0, function () {
|
|
405
|
-
var msg, data, oId, time, userName, userNickname, userAvatarURL, content, md,
|
|
406
|
-
return __generator(this, function (
|
|
405
|
+
var msg, data, oId, time, userName, userNickname, userAvatarURL, content, md, data_1, oId, count, got, whoGive, whoGot;
|
|
406
|
+
return __generator(this, function (_a) {
|
|
407
407
|
msg = JSON.parse(e.data);
|
|
408
408
|
data = null;
|
|
409
409
|
switch (msg.type) {
|
|
@@ -424,17 +424,10 @@ var ChatRoom = /** @class */ (function () {
|
|
|
424
424
|
case 'msg': {
|
|
425
425
|
oId = msg.oId, time = msg.time, userName = msg.userName, userNickname = msg.userNickname, userAvatarURL = msg.userAvatarURL, content = msg.content, md = msg.md;
|
|
426
426
|
try {
|
|
427
|
-
|
|
428
|
-
if (msgType === 'redPacket') {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
time: time,
|
|
432
|
-
userName: userName,
|
|
433
|
-
userNickname: userNickname,
|
|
434
|
-
userAvatarURL: userAvatarURL,
|
|
435
|
-
redpacket: { msg: msg_1, recivers: recivers, money: money, count: count, type: type, got: got, who: who }
|
|
436
|
-
};
|
|
437
|
-
msg_1.type = 'redPacket';
|
|
427
|
+
data_1 = JSON.parse(content);
|
|
428
|
+
if (data_1.msgType === 'redPacket') {
|
|
429
|
+
content = data_1;
|
|
430
|
+
msg.type = 'redPacket';
|
|
438
431
|
break;
|
|
439
432
|
}
|
|
440
433
|
}
|