File manager - Edit - /home/c14075/dragmet-ural.ru/www/bitrix/js/im/v2/component/recent-list/src/menu/pin-manager.js
Back
import {RestMethod} from 'im.v2.const'; export class PinManager { store: Object = null; restClient: Object = null; constructor($Bitrix) { this.store = $Bitrix.Data.get('controller').store; this.restClient = $Bitrix.RestClient.get(); } pinDialog(dialogId: string) { this.store.dispatch('recent/pin', {id: dialogId, action: true}); const queryParams = {'DIALOG_ID': dialogId, 'ACTION': 'Y'}; this.restClient.callMethod(RestMethod.imRecentPin, queryParams).catch(error => { console.error('Im.RecentList: error pinning chat', error); this.store.dispatch('recent/pin', {id: dialogId, action: false}); }); } unpinDialog(dialogId: string) { this.store.dispatch('recent/pin', {id: dialogId, action: false}); const queryParams = {'DIALOG_ID': dialogId, 'ACTION': 'N'}; this.restClient.callMethod(RestMethod.imRecentPin, queryParams).catch(error => { console.error('Im.RecentList: error unpinning chat', error); this.store.dispatch('recent/pin', {id: dialogId, action: true}); }); } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.23 |
proxy
|
phpinfo
|
Settings