Skip to content

Commit 77eafc1

Browse files
committed
remove remaining console warnings
1 parent 8f134cc commit 77eafc1

File tree

5 files changed

+34
-38
lines changed

5 files changed

+34
-38
lines changed

lib/components/page/hint.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ var default_1 = (function (_super) {
2929
default_1.prototype.render = function () {
3030
var _a = this.props, task = _a.task, hintPosition = _a.hintPosition, nextHint = _a.nextHint, prevHint = _a.prevHint;
3131
var hints = task && task.hints ? task.hints : null;
32-
console.log(hintPosition, hints, nextHint);
3332
if (hintPosition < 0 || !hints || !hints.length) {
3433
return React.createElement("div", null);
3534
}

lib/components/progress/progress.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ exports.default = function (_a) {
8585
'isActive': isActive
8686
}), secondaryText: chapter.description, secondaryTextLines: chapter.description.length > 35 ? 2 : 1, initiallyOpen: chapterIndex === 0, leftIcon: chapter.completed ? React.createElement(AllCompleted, null) : null, primaryTogglesNestedList: chapterIndex === position.chapter && !chapter.completed, nestedItems: chapter.pages.map(function (page, pageIndex) {
8787
var itemPosition = { chapter: chapterIndex, page: pageIndex };
88-
return React.createElement(ProgressPage, {page: page, itemPosition: itemPosition, position: position});
88+
return React.createElement(ProgressPage, {key: 'c' + chapterIndex + 'p' + pageIndex, page: page, itemPosition: itemPosition, position: position});
8989
})});
9090
}))));
9191
};

lib/reducers/alert/alert.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,14 @@ function alertReducer(alert, action) {
4242
};
4343
return current;
4444
}
45-
else {
46-
statusBarAlert.style.color = '#9DA5B4';
47-
current = {
48-
message: result.msg,
49-
open: true,
50-
action: 'note',
51-
duration: result.duration || 2500
52-
};
53-
return current;
54-
}
45+
statusBarAlert.style.color = '#9DA5B4';
46+
current = {
47+
message: result.msg,
48+
open: true,
49+
action: 'note',
50+
duration: result.duration || 2500
51+
};
52+
return current;
5553
case Type.PAGE_COMPLETE:
5654
return {
5755
message: "Page " + (action.payload.position.page + 1) + " Complete",

src/components/progress/progress.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export default ({progress, position}) => (
8383
primaryTogglesNestedList={chapterIndex === position.chapter && !chapter.completed}
8484
nestedItems={chapter.pages.map((page: CR.Page, pageIndex: number) => {
8585
const itemPosition = {chapter: chapterIndex, page: pageIndex};
86-
return <ProgressPage page={page} itemPosition={itemPosition} position={position}/>;
86+
return <ProgressPage key={'c' + chapterIndex + 'p' + pageIndex} page={page} itemPosition={itemPosition} position={position}/>;
8787
})}/>;
8888
})}
8989
</List>

src/reducers/alert/alert.ts

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -43,38 +43,37 @@ export default function alertReducer(alert = defaultAlert, action: CR.Action): C
4343
duration: result.duration || 2500
4444
};
4545
return current;
46-
} else {
47-
// Alert
48-
statusBarAlert.style.color = '#9DA5B4';
49-
current = {
50-
message: result.msg,
51-
open: true,
52-
action: 'note',
53-
duration: result.duration || 2500
54-
};
55-
return current;
5646
}
57-
case Type.PAGE_COMPLETE:
47+
// Alert
48+
statusBarAlert.style.color = '#9DA5B4';
49+
current = {
50+
message: result.msg,
51+
open: true,
52+
action: 'note',
53+
duration: result.duration || 2500
54+
};
55+
return current;
56+
case Type.PAGE_COMPLETE:
5857
return {
5958
message: `Page ${action.payload.position.page + 1} Complete`,
6059
open: true,
6160
action: 'pass',
6261
duration: 2000
6362
};
64-
case Type.CHAPTER_COMPLETE:
65-
return {
66-
message: `Chapter ${action.payload.chapter + 1} Complete`,
67-
open: true,
68-
action: 'pass',
69-
duration: 2000
70-
};
71-
case Type.PROJECT_COMPLETE:
72-
return {
73-
message: 'Tutorial Complete',
74-
open: true,
75-
action: 'pass',
76-
duration: 2000
77-
};
63+
case Type.CHAPTER_COMPLETE:
64+
return {
65+
message: `Chapter ${action.payload.chapter + 1} Complete`,
66+
open: true,
67+
action: 'pass',
68+
duration: 2000
69+
};
70+
case Type.PROJECT_COMPLETE:
71+
return {
72+
message: 'Tutorial Complete',
73+
open: true,
74+
action: 'pass',
75+
duration: 2000
76+
};
7877
default:
7978
return alert;
8079
}

0 commit comments

Comments
 (0)