Browse Source

Drag and drop handle sending rights

master
Eduard Kuzmenko 4 years ago
parent
commit
ab8a2dfcab
  1. 12
      src/lib/appManagers/appImManager.ts

12
src/lib/appManagers/appImManager.ts

@ -222,7 +222,7 @@ export class AppImManager {
// @ts-ignore // @ts-ignore
const isFiles = _types.contains ? _types.contains('Files') : _types.indexOf('Files') >= 0; const isFiles = _types.contains ? _types.contains('Files') : _types.indexOf('Files') >= 0;
if(!isFiles) { // * skip dragging text case if(!isFiles || !this.canDrag()) { // * skip dragging text case
counter = 0; counter = 0;
return; return;
} }
@ -318,11 +318,13 @@ export class AppImManager {
dropsContainer.classList.add('drops-container'); dropsContainer.classList.add('drops-container');
} }
private onDocumentPaste = (e: ClipboardEvent | DragEvent, attachType?: 'media' | 'document') => { private canDrag() {
const peerId = this.chat?.peerId; const peerId = this.chat?.peerId;
if(!peerId || rootScope.overlayIsActive || (peerId < 0 && !appChatsManager.hasRights(peerId, 'send', 'send_media'))) { return !(!peerId || rootScope.overlayIsActive || (peerId < 0 && !appChatsManager.hasRights(peerId, 'send', 'send_media')));
return; }
}
private onDocumentPaste = (e: ClipboardEvent | DragEvent, attachType?: 'media' | 'document') => {
if(!this.canDrag()) return;
//console.log('document paste'); //console.log('document paste');
//console.log('item', event.clipboardData.getData()); //console.log('item', event.clipboardData.getData());

Loading…
Cancel
Save