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.
@@ -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, _a, msg_1, recivers, money, count, type, got, who, msgType, oId, count, got, whoGive, whoGot;
406
- return __generator(this, function (_b) {
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
- _a = JSON.parse(content), msg_1 = _a.msg, recivers = _a.recivers, money = _a.money, count = _a.count, type = _a.type, got = _a.got, who = _a.who, msgType = _a.msgType;
428
- if (msgType === 'redPacket') {
429
- data = {
430
- oId: oId,
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fishpi",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "A Package to use API of fishpi.",
5
5
  "main": "./lib/src/index.js",
6
6
  "files": [