Skip to content

Commit 57a6a36

Browse files
committed
remove final page task calls
1 parent 5b9ea3f commit 57a6a36

File tree

16 files changed

+20
-16
lines changed

16 files changed

+20
-16
lines changed

lib/actions/page.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
var test_1 = require('./test');
23
var _types_1 = require('./_types');
34
var store_1 = require('../store');
45
var _position = {
@@ -10,12 +11,14 @@ function pageNext() {
1011
var _a = store_1.default.getState().position, page = _a.page, chapter = _a.chapter;
1112
var chapters = store_1.default.getState().tutorial.chapters;
1213
if (page < chapters[chapter].pages.length - 1) {
14+
store_1.default.dispatch(test_1.testsLoad());
1315
position = {
1416
chapter: chapter,
1517
page: page + 1,
1618
};
1719
}
1820
else if (chapter < chapters.length - 1) {
21+
store_1.default.dispatch(test_1.testsLoad());
1922
position = {
2023
chapter: chapter + 1,
2124
page: 0,

lib/components/Page/PageToolbar/Continue/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ var Continue = (function (_super) {
3333
return {
3434
callNextPage: function () {
3535
dispatch(actions_1.pageNext());
36-
dispatch(actions_1.testsLoad());
3736
}
3837
};
3938
}),

lib/reducers/editor-actions/action-helpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function getCommand(actionString) {
1111
}
1212
exports.getCommand = getCommand;
1313
function getParams(actionString) {
14-
var parser = new parser_1.ParseParams;
14+
var parser = new parser_1.ParseParams();
1515
var command = getCommand(actionString);
1616
var params = actionString.substring(command.length + 1, actionString.length - 1);
1717
if (!params.length) {

lib/reducers/editor-actions/actions.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function editorActions(actionString) {
1717
if (params.length === 1) {
1818
editor_1.open(param, options);
1919
setTimeout(function () {
20-
resolve();
20+
resolve(true);
2121
}, 100);
2222
}
2323
break;
@@ -32,17 +32,17 @@ function editorActions(actionString) {
3232
break;
3333
case Type.INSERT:
3434
if (params.length === 1) {
35-
var content_2 = params[0];
35+
var content = params[0];
36+
editor_1.insert(content, {});
3637
setTimeout(function () {
37-
editor_1.insert(content_2, {});
3838
resolve(true);
3939
});
4040
}
4141
break;
4242
case Type.OPEN_CONSOLE:
4343
if (params.length === 0) {
44+
editor_1.openDevTools();
4445
setTimeout(function () {
45-
editor_1.openDevTools();
4646
resolve(true);
4747
});
4848
}

lib/reducers/tasks/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use strict";
22
var _types_1 = require('../../actions/_types');
33
var store_1 = require('../../store');
4-
var config_task_tests_1 = require('./config-task-tests');
4+
var config_task_tests_1 = require('../task-tests/config-task-tests');
55
var _tasks = [{
66
actions: [],
77
completed: false,

src/actions/page.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {testsLoad} from './test';
12
import {ROUTE_SET, PAGE_SET} from './_types';
23
import store from '../store';
34

@@ -11,11 +12,13 @@ export function pageNext(): Action {
1112
const {page, chapter} = store.getState().position;
1213
const {chapters} = store.getState().tutorial;
1314
if (page < chapters[chapter].pages.length - 1) {
15+
store.dispatch(testsLoad());
1416
position = {
1517
chapter,
1618
page: page + 1,
1719
};
1820
} else if (chapter < chapters.length - 1) {
21+
store.dispatch(testsLoad());
1922
position = {
2023
chapter: chapter + 1,
2124
page: 0,

src/components/Page/PageToolbar/Continue/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import {connect} from 'react-redux';
33
import FlatButton from 'material-ui/FlatButton';
4-
import {pageNext, testsLoad} from '../../../../actions';
4+
import {pageNext} from '../../../../actions';
55

66
const styles = {
77
zIndex: '10000',
@@ -11,7 +11,6 @@ const styles = {
1111
return {
1212
callNextPage: () => {
1313
dispatch(pageNext());
14-
dispatch(testsLoad());
1514
}
1615
};
1716
})

src/reducers/editor-actions/action-helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function getCommand(actionString: string): string {
1212

1313
export function getParams(actionString: string): string[] {
1414
// content in brackets, split by comma
15-
let parser = new ParseParams;
15+
let parser = new ParseParams();
1616
let command = getCommand(actionString);
1717
let params = actionString.substring(command.length + 1, actionString.length - 1); // trim brackets
1818
if (!params.length) {

src/reducers/editor-actions/actions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function editorActions(actionString: string): Promise<void> {
1818
if (params.length === 1) {
1919
open(param, options);
2020
setTimeout(() => {
21-
resolve();
21+
resolve(true);
2222
}, 100);
2323
}
2424
break;
@@ -36,16 +36,16 @@ export function editorActions(actionString: string): Promise<void> {
3636
// let obj = getOptions(params[0]);
3737
const content: string = params[0];
3838
// let options: object = obj.options;
39+
insert(content, {});
3940
setTimeout(() => {
40-
insert(content, {});
4141
resolve(true);
4242
});
4343
}
4444
break;
4545
case Type.OPEN_CONSOLE:
4646
if (params.length === 0) {
47+
openDevTools();
4748
setTimeout(() => {
48-
openDevTools();
4949
resolve(true);
5050
});
5151
}

src/reducers/tasks/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {PAGE_SET} from '../../actions/_types';
22
import store from '../../store';
3-
import {configTaskTests} from './config-task-tests';
3+
import {configTaskTests} from '../task-tests/config-task-tests';
44

55
const _tasks: CR.Task[] = [{
66
actions: [],

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"src/reducers/editor-actions/action-reducer.ts",
8989
"src/reducers/editor-actions/actions.ts",
9090
"src/reducers/editor-actions/index.ts",
91-
"src/reducers/editor-actions/parser.ts",
91+
"src/reducers/editor-actions/parser/index.ts",
9292
"src/reducers/hint-position/index.ts",
9393
"src/reducers/index.ts",
9494
"src/reducers/package-json/index.ts",
@@ -98,8 +98,8 @@
9898
"src/reducers/progress/local-storage.ts",
9999
"src/reducers/route/index.ts",
100100
"src/reducers/task-position/index.ts",
101+
"src/reducers/task-tests/config-task-tests.ts",
101102
"src/reducers/task-tests/index.ts",
102-
"src/reducers/tasks/config-task-tests.ts",
103103
"src/reducers/tasks/index.ts",
104104
"src/reducers/test-run/index.ts",
105105
"src/reducers/test-run/parse-loaders.ts",

0 commit comments

Comments
 (0)