diff --git a/build/icons/icon.ico b/build/icons/icon.ico index e5f8607..f23b445 100644 Binary files a/build/icons/icon.ico and b/build/icons/icon.ico differ diff --git a/src/renderer/components/ChatHead.vue b/src/renderer/components/ChatHead.vue index f7aa94e..c65d85f 100644 --- a/src/renderer/components/ChatHead.vue +++ b/src/renderer/components/ChatHead.vue @@ -8,7 +8,6 @@ multiple: filteredImages.length > 1, }" @mousedown="handleMouseDown" - @mousemove="handleMouseMove" @mouseup="handleMouseUp" @dblclick="hideChatHead" > @@ -79,33 +78,27 @@ export default { }, data: () => ({ isDragging: false, - delta: 10, + delta: 50, startX: null, startY: null, }), methods: { handleMouseDown(event) { - this.isDragging = false; this.startX = event.pageX; this.startY = event.pageY; }, - handleMouseMove() { - this.isDragging = true; - }, handleMouseUp(event) { const { delta, startX, startY, isDragging, hidden } = this; const diffX = Math.abs(event.pageX - startX); const diffY = Math.abs(event.pageY - startY); if ( - isDragging === false && diffX < delta && diffY < delta && !hidden ) { this.$emit('select'); } - this.isDragging = false; }, hideChatHead() { this.$emit('hide'); diff --git a/src/renderer/views/Main.vue b/src/renderer/views/Main.vue index 2c5c68f..19e86c8 100644 --- a/src/renderer/views/Main.vue +++ b/src/renderer/views/Main.vue @@ -117,7 +117,7 @@ export default { ipcRenderer.removeAllListeners('update_downloaded'); this.updateAvailable = true; }); - ipcRenderer.on('checking_update', (value) => { + ipcRenderer.on('checking_update', value => { console.log('Checking for update: ', value); ipcRenderer.removeAllListeners('checking_update'); }); @@ -271,6 +271,16 @@ export default { } }, updateChats(stringifiedChats) { + if (this.heads === null) { + // workaround for initial chat window scroll + // position set to middle (for some reeason) + const webview = document.querySelector('#messengerWebView'); + setTimeout(() => { + webview.executeJavaScript(` + scrollToBottom(); + `); + }, 1000); + } this.heads = JSON.parse(stringifiedChats); }, updateLayout() { diff --git a/static/icon.ico b/static/icon.ico index e5f8607..f23b445 100644 Binary files a/static/icon.ico and b/static/icon.ico differ