File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -71,18 +71,21 @@ export async function exportToPng(fileNameFormat: string) {
71
71
} )
72
72
}
73
73
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 ) {
81
77
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' ) )
84
80
} )
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
+ }
86
89
87
90
// hide code block copy button
88
91
const copyButtons = thread . querySelectorAll ( 'pre button' )
You can’t perform that action at this time.
0 commit comments