Drag and drop handle sending rights
This commit is contained in:
parent
53b0de7ae3
commit
ab8a2dfcab
@ -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,12 +318,14 @@ 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…
x
Reference in New Issue
Block a user