Skip to content

Commit eaf7c76

Browse files
lsbypionxzh
authored andcommitted
fix: fixed user conversations disappearing when exporting screenshots
1 parent eccd564 commit eaf7c76

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/exporter/image.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,21 @@ export async function exportToPng(fileNameFormat: string) {
7171
})
7272
}
7373

74-
// hide buttons
75-
const buttonWrappers = document.querySelectorAll<HTMLDivElement>('main .flex.empty\\:hidden')
76-
buttonWrappers.forEach((wrapper) => {
77-
if (!wrapper.querySelector('button')) return
78-
// ignore codeblock
79-
if (wrapper.closest('pre')) return
80-
74+
// hide switch context button
75+
const switchContextBuuton1 = thread.querySelectorAll('div.mb-2.flex.gap-3.empty\\:hidden.mr-1.flex-row-reverse')
76+
if (switchContextBuuton1) {
8177
effect.add(() => {
82-
wrapper.style.display = 'none'
83-
return () => wrapper.style.display = ''
78+
switchContextBuuton1.forEach(a => a.classList.add('hidden'))
79+
return () => switchContextBuuton1.forEach(a => a.classList.remove('hidden'))
8480
})
85-
})
81+
}
82+
const switchContextBuuton2 = thread.querySelectorAll('div.mb-2.flex.gap-3.empty\\:hidden.-ml-2')
83+
if (switchContextBuuton2) {
84+
effect.add(() => {
85+
switchContextBuuton2.forEach(a => a.classList.add('hidden'))
86+
return () => switchContextBuuton2.forEach(a => a.classList.remove('hidden'))
87+
})
88+
}
8689

8790
// hide code block copy button
8891
const copyButtons = thread.querySelectorAll('pre button')

0 commit comments

Comments
 (0)