File tree Expand file tree Collapse file tree 2 files changed +16
-13
lines changed
packages/app/src/app/overmind/effects/vscode Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -154,18 +154,16 @@ export class ModelsHandler {
154154 }
155155
156156 public clearComments ( ) {
157- if ( this . sandbox . featureFlags . comments ) {
158- Object . values ( this . moduleModels ) . forEach ( moduleModel => {
159- if ( ! moduleModel . model ) {
160- return ;
161- }
162- moduleModel . comments = [ ] ;
163- moduleModel . currentCommentDecorations = moduleModel . model . deltaDecorations (
164- moduleModel . currentCommentDecorations ,
165- [ ]
166- ) ;
167- } ) ;
168- }
157+ Object . values ( this . moduleModels ) . forEach ( moduleModel => {
158+ if ( ! moduleModel . model ) {
159+ return ;
160+ }
161+ moduleModel . comments = [ ] ;
162+ moduleModel . currentCommentDecorations = moduleModel . model . deltaDecorations (
163+ moduleModel . currentCommentDecorations ,
164+ [ ]
165+ ) ;
166+ } ) ;
169167 }
170168
171169 public isModuleOpened ( module : Module ) {
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ import * as childProcess from 'node-services/lib/child_process';
2929import { TextOperation } from 'ot' ;
3030import { json } from 'overmind' ;
3131import io from 'socket.io-client' ;
32+ import { hasPermission } from '@codesandbox/common/lib/utils/permission' ;
3233
3334import { EXTENSIONS_LOCATION , VIM_EXTENSION_ID } from './constants' ;
3435import {
@@ -1202,7 +1203,11 @@ export class VSCodeEffect {
12021203
12031204 this . modelCursorPositionListener = activeEditor . onDidChangeCursorPosition (
12041205 cursor => {
1205- if ( sandbox ?. featureFlags . comments ) {
1206+ if (
1207+ sandbox &&
1208+ sandbox . featureFlags . comments &&
1209+ hasPermission ( sandbox . authorization , 'comment' )
1210+ ) {
12061211 const model = activeEditor . getModel ( ) ;
12071212
12081213 this . modelsHandler . updateLineCommentIndication (
You can’t perform that action at this time.
0 commit comments