Skip to content

Commit 681b844

Browse files
authored
Merge pull request #16 from lowcoding/v1.7.5
🎈 perf: webview 交互优化
2 parents c351d96 + d6f17fb commit 681b844

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "lowcode",
44
"description": "lowcode tool, support ChatGPT",
55
"author": "wjkang <[email protected]>",
6-
"version": "1.7.4",
6+
"version": "1.7.5",
77
"icon": "asset/icon.png",
88
"publisher": "wjkang",
99
"repository": "https://github.com/lowcoding/lowcode-vscode",

webview-react/src/pages/blocks/Detail/index.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,14 @@ export default () => {
168168
path,
169169
createPath,
170170
privateMaterials: model.selectedMaterial.privateMaterials,
171-
}).then(() => {
172-
model.setDirectoryModalVsible(false);
173-
model.setLoding(false);
174-
message.success('生成成功');
175-
});
171+
})
172+
.then(() => {
173+
model.setDirectoryModalVsible(false);
174+
message.success('生成成功');
175+
})
176+
.finally(() => {
177+
model.setLoding(false);
178+
});
176179
}}
177180
/>
178181
<JsonToTs

webview-react/src/pages/chatGPT/presenter.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const usePresenter = () => {
2121
model.listRef.current?.scrollTo(0, model.listRef.current.scrollHeight);
2222
});
2323

24-
const initPrompt = localStorage.getItem('askChatGPT');
24+
let initPrompt = localStorage.getItem('askChatGPT');
2525
let askPrompt = '';
2626
emitter.on('askChatGPT', (data) => {
2727
askPrompt = data;
@@ -30,10 +30,11 @@ export const usePresenter = () => {
3030
}
3131
service.startAsk('NewSessionWithPrompt', data);
3232
});
33-
localStorage.removeItem('askChatGPT');
3433
if (initPrompt && initPrompt !== askPrompt) {
3534
service.startAsk('NewSessionWithPrompt', initPrompt);
3635
}
36+
localStorage.removeItem('askChatGPT');
37+
initPrompt = '';
3738

3839
return () => {
3940
emitter.off('chatGPTChunk');

0 commit comments

Comments
 (0)