File manager - Edit - /home/c14075/dragmet-ural.ru/www/bitrix/js/im/v2/lib/old-chat-embedding/menu/src/recent/unread-manager.js
Back
import {RestMethod} from 'im.v2.const'; export class UnreadManager { store: Object = null; restClient: Object = null; constructor($Bitrix) { this.store = $Bitrix.Data.get('controller').store; this.restClient = $Bitrix.RestClient.get(); } readDialog(dialogId: string) { let queryParams; const dialog = this.store.getters['dialogues/get'](dialogId, true); if (dialog.counter > 0) { queryParams = {'DIALOG_ID': dialogId}; this.restClient.callMethod(RestMethod.imDialogRead, queryParams).catch(error => { console.error('Im.RecentList: error reading chat', error); }); return; } this.store.dispatch('recent/unread', {id: dialogId, action: false}); queryParams = {'DIALOG_ID': dialogId, 'ACTION': 'N'}; this.restClient.callMethod(RestMethod.imRecentUnread, queryParams).catch(error => { console.error('Im.RecentList: error reading chat', error); this.store.dispatch('recent/unread', {id: dialogId, action: true}); }); } unreadDialog(dialogId: string) { this.store.dispatch('recent/unread', {id: dialogId, action: true}); const queryParams = {'DIALOG_ID': dialogId, 'ACTION': 'Y'}; this.restClient.callMethod(RestMethod.imRecentUnread, queryParams).catch(error => { console.error('Im.RecentList: error unreading chat', error); this.store.dispatch('recent/unread', {id: dialogId, action: false}); }); } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.25 |
proxy
|
phpinfo
|
Settings