fix(assist): dev propose

This commit is contained in:
ShiKhu 2021-07-13 18:04:39 +03:00
parent 333a41c01f
commit 55d8db1718
2 changed files with 11 additions and 5 deletions

View file

@ -60,14 +60,16 @@ export default abstract class BaseScreen {
private boundingRect: DOMRect | null = null;
private getBoundingClientRect(): DOMRect {
if (this.boundingRect === null) {
this.boundingRect = this.overlay.getBoundingClientRect(); // expensive operation?
}
return this.boundingRect;
//if (this.boundingRect === null) {
return this.boundingRect = this.overlay.getBoundingClientRect(); // expensive operation?
//}
//return this.boundingRect;
}
getInternalCoordinates({ x, y }: Point): Point {
const { x: overlayX, y: overlayY, width } = this.getBoundingClientRect();
console.log("x y ", x,y,'ovx y', overlayX, overlayY, width)
const screenWidth = this.overlay.offsetWidth;
const scale = screenWidth / width;

View file

@ -4,6 +4,7 @@ import type MessageDistributor from '../MessageDistributor';
import type { TimedMessage } from '../Timed';
import type { Message } from '../messages'
import { ID_TP_MAP } from '../messages';
import store from 'App/store';
import { update, getState } from '../../store';
@ -285,10 +286,13 @@ export default class AssistManager {
update({ calling: CallingState.Requesting });
console.log('calling...')
const call = this.peer.call(this.peerID, localStream);
call.on('stream', stream => {
update({ calling: CallingState.True });
onStream(stream);
this.dataConnection?.send({
name: store.getState().getIn([ 'user', 'account', 'name']),
});
// @ts-ignore ??
this.md.overlay.addEventListener("mousemove", this.onMouseMove)
});