Skip to content

Commit

Permalink
加回 new chat
Browse files Browse the repository at this point in the history
  • Loading branch information
joe committed May 16, 2023
1 parent 6716522 commit 11af90f
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion js/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -2174,7 +2174,7 @@ function findGroupAndIndex(promptId) {
</div>
</td>
<td>
<div class="ellipsis">none</div>
<div class="ellipsis">${i18n("shortcut_key_tips_N")}</div>
</td>
<td>
<div class="shortcut-wrapper">
Expand Down Expand Up @@ -3612,6 +3612,25 @@ function findGroupAndIndex(promptId) {
return;
}

// mainKey + n: new chat
if (
questionDialog.style.display === "none" &&
settingsDialog.style.display === "none" &&
quickReplySettingsDialog.style.display === "none" &&
exportAndImportDialog.style.display === "none" &&
superPromptSettingsDialog.style.display === "none" &&
superPromptDialog.style.display === "none" &&
superPromptCategoryNameSettingsDialog.style.display === "none" &&
event[mainKey] &&
event.key.toLocaleLowerCase() === "n"
) {
event.preventDefault();
const newChatBtn = document.querySelector("nav").children[0];
newChatBtn.click();
return;
}


// mainKey + 1 ~ 0 number keyboard : open question dialog
if (
settingsDialog.style.display === "none" &&
Expand Down

0 comments on commit 11af90f

Please sign in to comment.