Skip to content

Commit 25a61ec

Browse files
authored
Update switchblock.ts - fixed switchContext ref
referenced a value that didn't get re-added back to the let statements near the top of the namespace in the switchblock.ts file due to issues merging code differences.
1 parent ed50a48 commit 25a61ec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

switchblock.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ namespace switchcase {
1414

1515
let switchManager: SwitchManager = new switchcase.SwitchManager();
1616
let currentSwitch: SwitchContext = switchManager.create("default");
17+
let switchContext: SwitchContext = currentSwitch;
1718
let currentSwitchName: string = "default";
1819
console.debug(currentSwitchName);
1920

@@ -109,8 +110,10 @@ namespace switchcase {
109110
//% blockSetVariable=switchContext
110111
export function createSwitchFull(name: string, value: any): SwitchContext {
111112
let cxt = createSwitch(name);
112-
if (cxt)
113+
if (cxt) {
113114
cxt.setValue(value);
115+
switchContext = cxt;
116+
}
114117

115118
return cxt;
116119
}

0 commit comments

Comments
 (0)