mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
1 line
7.1 KiB
JSON
1 line
7.1 KiB
JSON
|
|
{"ast":null,"code":"import _asyncToGenerator from \"C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { __decorate } from \"tslib\";\nimport { Injectable } from '@angular/core';\nimport * as FIFOProcessQueue from 'fifo-process-queue';\nlet ViewedMessageService = class ViewedMessageService {\n constructor() {\n this.viewQueue = FIFOProcessQueue( /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* ({\n room,\n userId,\n statusNum,\n statusText\n }, callback) {\n if (room.membersExcludeMe?.map) {\n const membersIds = room.membersExcludeMe.map(user => user._id);\n if (membersIds.includes(userId)) {\n if (statusText != 'offline') {\n room.deleteMessageToReceive(userId);\n }\n let n = 0;\n for (const message of room.messages) {\n if (message.online) {\n for (let id of membersIds) {\n if (message.addReceived(id)) {\n n++;\n // setTimeout(async() => {\n yield message.saveChanges();\n // }, 100 * n)\n }\n }\n }\n }\n\n setTimeout(function () {\n callback();\n }, 100);\n }\n }\n });\n return function (_x, _x2) {\n return _ref.apply(this, arguments);\n };\n }());\n this.viewReadQueue = FIFOProcessQueue( /*#__PURE__*/function () {\n var _ref2 = _asyncToGenerator(function* ({\n room\n }, callback) {\n const membersIds = room.membersExcludeMe.map(user => user._id);\n let n = 0;\n for (const message of room.messages) {\n if (message.online) {\n for (let id of membersIds) {\n if (message.addViewed(id)) {\n message.addReceived(id);\n n++;\n // setTimeout(async() => {\n yield message.saveChanges();\n // }, 100 * n)\n }\n }\n }\n }\n\n setTimeout(() => {\n callback();\n }, 100);\n });\n return function (_x3, _x4) {\n return _ref2.apply(this, arguments);\n };\n }());\n }\n request(room, userId, statusNum, statusText) {\n this.viewQueue.push({\n room,\n userId,\n statusNum,\n statusText\n });\n }\n requestReadAll(room) {\n this.viewReadQueue.push({\n room\n });\n }\n};\nViewedMessageService.ctorParameters = () => [];\nViewedMessageService = __decorate([Injectable({\n providedIn: 'root'\n})], ViewedMessageService);\nexport { ViewedMessageService };","map":{"version":3,"mappings":";;AAAA,SAASA,UAAU,QAAQ,eAAe;AAC1C,OAAO,KAAKC,gBAAgB,MAAM,oBAAoB;AAM/C,IAAMC,oBAAoB,GAA1B,MAAMA,oBAAoB;EAE/BC;IAGA,cAAS,GAAGF,gBAAgB;MAAA,6BAAC,WAAO;QAACG,IAAI;QAAEC,MAAM;QAAEC,SAAS;QAAEC;MAAU,CAAC,EAAEC,QAAQ,EAAI;QAErF,IAAGJ,IAAI,CAACK,gBAAgB,EAAEC,GAAG,EAAE;UAC7B,MAAMC,UAAU,GAAGP,IAAI,CAACK,gBAAgB,CAACC,GAAG,CAAEE,IAAI,IAAIA,IAAI,CAACC,GAAG,CAAC;UAE/D,IAAGF,UAAU,CAACG,QAAQ,CAACT,MAAM,CAAC,EAAE;YAE9B,IAAGE,UAAU,IAAI,SAAS,EAAE;cAC1BH,IAAI,CAACW,sBAAsB,CAACV,MAAM,CAAC;;YAGrC,IAAIW,CAAC,GAAG,CAAC;YACT,KAAK,MAAMC,OAAO,IAAIb,IAAI,CAACc,QAAQ,EAAE;cACnC,IAAGD,OAAO,CAACE,MAAM,EAAE;gBACjB,KAAI,IAAIC,EAAE,IAAIT,UAAU,EAAE;kBACxB,IAAGM,OAAO,CAACI,WAAW,CAACD,EAAE,CAAC,EAAE;oBAC1BJ,CAAC,EAAE;oBACH;oBACE,MAAMC,OAAO,CAACK,WAAW,EAAE;oBAC7B;;;;;;YAMRC,UAAU,CAAC;cACTf,QAAQ,EAAE;YACZ,CAAC,EAAE,GAAG,CAAC;;;MAIb,CAAC;MAAA;QAAA;MAAA;IAAA,IAAC;IAGF,kBAAa,GAAGP,gBAAgB;MAAA,8BAAC,WAAO;QAACG;MAAI,CAAC,EAAEI,QAAQ,EAAI;QAE1D,MAAMG,UAAU,GAAaP,IAAI,CAACK,gBAAgB,CAACC,GAA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