From 95f8c16be0cddc5d7b4f16678f5ca0eb1a8467e3 Mon Sep 17 00:00:00 2001 From: cyhhao Date: Tue, 14 Feb 2023 16:10:44 +0800 Subject: [PATCH 1/2] Fix Chinese input method Enter on Safari --- src-tauri/src/scripts/core.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src-tauri/src/scripts/core.js b/src-tauri/src/scripts/core.js index 734a277..d852b55 100644 --- a/src-tauri/src/scripts/core.js +++ b/src-tauri/src/scripts/core.js @@ -101,6 +101,11 @@ async function init() { } }); + // Fix Chinese input method "Enter" on Safari + document.addEventListener("keydown",(e)=>{ + if(e.keyCode==229) e.stopPropagation(); + }, true) + if (window.location.host === 'chat.openai.com') { window.__sync_prompts = async function() { await invoke('sync_prompts', { time: Date.now() }); From fde75aa81ea84761acc748418221a6007c798305 Mon Sep 17 00:00:00 2001 From: cyhhao Date: Tue, 14 Feb 2023 16:18:52 +0800 Subject: [PATCH 2/2] format --- src-tauri/src/scripts/core.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src-tauri/src/scripts/core.js b/src-tauri/src/scripts/core.js index d852b55..2a3bc47 100644 --- a/src-tauri/src/scripts/core.js +++ b/src-tauri/src/scripts/core.js @@ -102,8 +102,8 @@ async function init() { }); // Fix Chinese input method "Enter" on Safari - document.addEventListener("keydown",(e)=>{ - if(e.keyCode==229) e.stopPropagation(); + document.addEventListener("keydown", (e) => { + if(e.keyCode == 229) e.stopPropagation(); }, true) if (window.location.host === 'chat.openai.com') {