File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
packages/app/src/app/overmind/namespaces/live Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 66 UserViewRange ,
77} from '@codesandbox/common/lib/types' ;
88import { logBreadcrumb } from '@codesandbox/common/lib/utils/analytics/sentry' ;
9+ import { COMMENTS } from '@codesandbox/common/lib/utils/feature-flags' ;
10+ import { hasPermission } from '@codesandbox/common/lib/utils/permission' ;
911import { Action , AsyncAction , Operator } from 'app/overmind' ;
1012import { withLoadApp } from 'app/overmind/factories' ;
1113import getItems from 'app/overmind/utils/items' ;
@@ -79,6 +81,11 @@ export const roomJoined: AsyncAction<{
7981 } ) ;
8082
8183 effects . vscode . openModule ( state . editor . currentModule ) ;
84+
85+ if ( COMMENTS && hasPermission ( sandbox . authorization , 'comment' ) ) {
86+ actions . comments . getSandboxComments ( sandbox . id ) ;
87+ }
88+
8289 state . editor . isLoading = false ;
8390} ) ;
8491
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export const onSave: Operator<LiveMessage<{
2121 inserted_at : string ;
2222 version : number ;
2323 path : string ;
24- } > > = mutate ( ( { state } , { data } ) => {
24+ } > > = mutate ( ( { state, effects } , { data } ) => {
2525 const sandbox = state . editor . currentSandbox ;
2626
2727 if ( ! sandbox ) {
@@ -39,6 +39,7 @@ export const onSave: Operator<LiveMessage<{
3939 module . updatedAt = data . updated_at ;
4040 module . insertedAt = data . inserted_at ;
4141 sandbox . version = data . version ;
42+ effects . vscode . sandboxFsSync . writeFile ( state . editor . modulesByPath , module ) ;
4243} ) ;
4344
4445export const onJoin : Operator < LiveMessage < {
You can’t perform that action at this time.
0 commit comments