Skip to content

Commit 8648f42

Browse files
christianalfoniCompuIves
authored andcommitted
Live fixes (codesandbox#2413)
* Fix selection issue * Fix updated messages for modules and directories * Fix moving directories and refactor a bit * Fix deleting directory
1 parent 90b7cd0 commit 8648f42

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

packages/app/src/app/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,14 @@ async function initialize() {
178178

179179
overmind = createOvermind(config, {
180180
devtools:
181-
window.opener && window.opener !== window && !window.chrome
181+
(window.opener && window.opener !== window) || !window.chrome
182182
? false
183183
: 'localhost:3031',
184-
name: 'CodeSandbox',
184+
name:
185+
'CodeSandbox - ' +
186+
(navigator.userAgent.indexOf('Chrome/76') > 0
187+
? 'Chrome'
188+
: 'Canary'),
185189
logProxies: true,
186190
});
187191

packages/app/src/app/overmind/effects/live/index.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,10 @@ export default {
194194
});
195195
},
196196
sendDirectoryDeleted(directoryShortid: string) {
197-
this.send(
198-
'directory:deleted',
199-
{
200-
type: 'directory',
201-
directoryShortid,
202-
}
203-
// When should we send module? Should we pass it when we should send it? Probably yeah
204-
// { sendModule: false }
205-
);
197+
this.send('directory:deleted', {
198+
type: 'directory',
199+
directoryShortid,
200+
});
206201
},
207202
sendModuleCreated(module: Module) {
208203
this.send('module:created', {

packages/app/src/app/overmind/namespaces/editor/actions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,15 @@ export const codeSaved: AsyncAction<{
154154
export const codeChanged: Action<{
155155
code: string;
156156
moduleShortid: string;
157-
ignoreLive?: boolean;
158-
}> = ({ effects, state, actions }, { code, moduleShortid, ignoreLive }) => {
157+
noLive?: boolean;
158+
}> = ({ effects, state, actions }, { code, moduleShortid, noLive }) => {
159159
effects.analytics.trackOnce('Change Code');
160160

161161
const module = state.editor.currentSandbox.modules.find(
162162
module => module.shortid === moduleShortid
163163
);
164164

165-
if (state.live.isLive && !ignoreLive) {
165+
if (state.live.isLive && !noLive) {
166166
state.live.receivingCode = true;
167167
effects.live.sendCodeUpdate(moduleShortid, module.code, code);
168168
state.live.receivingCode = false;

0 commit comments

Comments
 (0)