Skip to content

Commit 1fad250

Browse files
committed
fix pinning
1 parent 90f366a commit 1fad250

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

apps/remix-ide/src/app/plugins/remix-ai-assistant.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export class RemixAIAssistant extends ViewPlugin {
3838
}
3939

4040
async onActivation() {
41+
this.call('sidePanel', 'pinView', this.profile)
4142
}
4243

4344
onDeactivation() {

libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,15 @@ export const TabsUI = (props: TabsUIProps) => {
281281
const content = await props.plugin.call('fileManager', 'readFile', path)
282282
if ((tabsState.currentExt === 'sol') || (tabsState.currentExt === 'vy') || (tabsState.currentExt === 'circom')) {
283283
setExplaining(true)
284-
// if plugin is pinned,
285-
await props.plugin.call('sidePanel', 'showContent', 'remixaiassistant')
286-
setTimeout(async () => {
287-
await props.plugin.call('remixAI', 'chatPipe', 'code_explaining', content)
288-
}, 500)
284+
try {
285+
await props.plugin.call('sidePanel', 'showContent', 'remixaiassistant')
286+
}
287+
catch (e) {
288+
// do nothing
289+
}
290+
291+
await props.plugin.call('remixAI', 'chatPipe', 'code_explaining', content)
292+
289293
setExplaining(false)
290294
_paq.push(['trackEvent', 'ai', 'remixAI', 'explain_file', content])
291295
}

0 commit comments

Comments
 (0)