File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -207,8 +207,8 @@ const processPosts = postElements => filterPostElements(postElements).forEach(as
207207 const tags = editedTagsMap . get ( getTimelineItemWrapper ( postElement ) ) ;
208208 tags && addFakeTagsToFooter ( postElement , tags ) ;
209209
210- const { state } = await timelineObject ( postElement ) ;
211- if ( [ 'ask' , 'submission' ] . includes ( state ) === false ) {
210+ const { state, canEdit } = await timelineObject ( postElement ) ;
211+ if ( canEdit && [ 'ask' , 'submission' ] . includes ( state ) === false ) {
212212 const clonedControlButton = cloneControlButton ( controlButtonTemplate , { click : togglePopupDisplay } ) ;
213213 insertControlButton ( postElement , clonedControlButton , buttonClass ) ;
214214 }
Original file line number Diff line number Diff line change @@ -156,10 +156,10 @@ const onButtonClicked = async function ({ currentTarget: controlButton }) {
156156} ;
157157
158158const processPosts = postElements => filterPostElements ( postElements ) . forEach ( async postElement => {
159- const { state, trail = [ ] , content = [ ] } = await timelineObject ( postElement ) ;
159+ const { state, canEdit , trail = [ ] , content = [ ] } = await timelineObject ( postElement ) ;
160160 const items = trail . length + ( content . length ? 1 : 0 ) ;
161161
162- if ( [ 'ask' , 'submission' ] . includes ( state ) === false ) {
162+ if ( canEdit && [ 'ask' , 'submission' ] . includes ( state ) === false ) {
163163 const clonedControlButton = cloneControlButton ( controlButtonTemplate , { click : event => onButtonClicked ( event ) . catch ( showErrorModal ) } , items < 2 ) ;
164164 insertControlButton ( postElement , clonedControlButton , buttonClass ) ;
165165 }
You can’t perform that action at this time.
0 commit comments