Skip to content

Commit

Permalink
Merge pull request #302 from x1unix/fix/issue-264
Browse files Browse the repository at this point in the history
Always reset output before run
  • Loading branch information
x1unix authored Jan 12, 2024
2 parents 396d271 + 6e3bb72 commit 19345e6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion web/src/lib/go/wrapper/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export interface ImportObject {
*
* @deprecated
* **WARNING:** Since Go 1.21.x this attribute was replaced by `gojs` namespace.
* @
*/
go: { [k: string]: ImportFunction }

Expand Down
2 changes: 1 addition & 1 deletion web/src/lib/go/wrapper/wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const getImportNamespace = (go: GoInstance) => (
* @param overlay Overlay object
* @param globalValue global namespace
*/
export const wrapGlobal = (overlay: object = {}, globalValue: object = window || globalThis || DedicatedWorkerGlobalScope) => {
export const wrapGlobal = (overlay: object = {}, globalValue: object = window || globalThis) => {
const mockObject = {
...overlay,
Go: GoWrapper,
Expand Down
2 changes: 1 addition & 1 deletion web/src/store/dispatchers/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const hasProgramTimeoutError = (events: EvalEvent[]) => {

const dispatchEvalEvents = (dispatch: DispatchFn, events: EvalEvent[]) => {
// TODO: support cancellation
dispatch(newProgramStartAction());

if (!events?.length) {
dispatch(newProgramFinishAction());
Expand Down Expand Up @@ -92,7 +93,6 @@ const dispatchEvalEvents = (dispatch: DispatchFn, events: EvalEvent[]) => {
// approach used in official playground, so should be enough for us.
let programEndTime = lastElem(eventsWithDelay)?.Delay ?? 0;

dispatch(newProgramStartAction());
eventsWithDelay.forEach(event => {
setTimeoutNanos(() => {
dispatch(newProgramWriteAction(event))
Expand Down

0 comments on commit 19345e6

Please sign in to comment.