File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
packages/app/src/app/overmind Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1136,8 +1136,11 @@ export class VSCodeEffect {
11361136
11371137 if ( activeEditor && activeEditor . getModel ( ) ) {
11381138 const modulePath = activeEditor . getModel ( ) . uri . path ;
1139+ const currentModule = this . options . getCurrentModule ( ) ;
11391140
1140- activeEditor . updateOptions ( { readOnly : this . readOnly } ) ;
1141+ activeEditor . updateOptions ( {
1142+ readOnly : this . readOnly || currentModule ?. isBinary ,
1143+ } ) ;
11411144
11421145 if ( ! modulePath . startsWith ( '/sandbox' ) ) {
11431146 return ;
@@ -1153,16 +1156,16 @@ export class VSCodeEffect {
11531156 ) ;
11541157 }
11551158
1156- const currentModule = this . options . getCurrentModule ( ) ;
1157-
11581159 if (
11591160 currentModule &&
11601161 modulePath === `/sandbox${ currentModule . path } ` &&
11611162 currentModule . code !== undefined &&
1162- activeEditor . getValue ( ) !== currentModule . code
1163+ activeEditor . getValue ( ) !== currentModule . code &&
1164+ ! currentModule . isBinary
11631165 ) {
11641166 // This means that the file in Cerebral is dirty and has changed,
11651167 // VSCode only gets saved contents. In this case we manually set the value correctly.
1168+
11661169 this . modelsHandler . isApplyingOperation = true ;
11671170 const model = activeEditor . getModel ( ) ;
11681171 model . applyEdits ( [
Original file line number Diff line number Diff line change @@ -147,6 +147,7 @@ export const saveCode: AsyncAction<{
147147
148148 module . insertedAt = updatedModule . insertedAt ;
149149 module . updatedAt = updatedModule . updatedAt ;
150+ module . isBinary = updatedModule . isBinary ;
150151
151152 const savedCode =
152153 updatedModule . code === module . code ? null : updatedModule . code ;
You can’t perform that action at this time.
0 commit comments