WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
This repository was archived by the owner on Nov 16, 2025. It is now read-only.

Commit 562bd1c

Browse files
committed
fix(macro): Fix existing macro selection logic
1 parent ce91e01 commit 562bd1c

File tree

5 files changed

+17
-12
lines changed

5 files changed

+17
-12
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "ChatGPT Augment",
4-
"version": "1.7.2",
4+
"version": "1.7.3",
55
"description": "Enhance chat with ChatGPT-Augment: auto-continue, macros, token count, prompts, gradients, JSON format.",
66
"content_scripts": [
77
{

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "chatgpt-augment",
33
"private": true,
4-
"version": "1.7.2",
4+
"version": "1.7.3",
55
"type": "module",
66
"license": "WTFPL",
77
"scripts": {

src/comp/modals/MacroAddModal.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,16 @@ export const MacroAddModal = ({
8787
(e: MouseEvent) => (e.preventDefault(), setPrompt(""), setShortcut("")),
8888
[]
8989
);
90-
const handleShortcutPick = useCallback((item: AutocompleteItem) => {
91-
const shortcut = item.value;
92-
const matching = macros[shortcut];
93-
if (matching) {
94-
setPrompt(matching);
95-
}
96-
}, []);
90+
const handleShortcutPick = useCallback(
91+
(item: AutocompleteItem) => {
92+
const shortcut = item.value;
93+
const matching = macros[shortcut];
94+
if (matching) {
95+
setPrompt(matching);
96+
}
97+
},
98+
[macros]
99+
);
97100
const exists = opened && macros[trueShortcut];
98101
const data = Object.entries(macros).map(([key, value]) => ({
99102
prompt: `${value.slice(0, CUTOFF)}${value.length > CUTOFF ? "..." : ""}`,

src/comp/workers/ConversationMenu.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ export const ConversationMenu = () => {
7474

7575
target.click();
7676
const els = await handlers.wait?.(parent, "button", 3);
77-
console.log(els);
78-
if (!els) return;
77+
if (!els?.length) return handlers.bail?.();
7978
const edit = els[0];
8079
edit.click();
8180
},

src/lib/messageSerializer.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ const nhm = new NodeHtmlMarkdown(
88
{
99
div: {
1010
postprocess({ node }) {
11-
if (node.classList.contains("items-center"))
11+
if (
12+
node.classList.contains("items-center") || // title of a codebloxk
13+
node.classList.contains("border") // moderation message
14+
)
1215
return PostProcessResult.RemoveNode;
1316
return PostProcessResult.NoChange;
1417
},

0 commit comments

Comments
 (0)