Bug#4 - Liking an article when logged out
What is the current bug behavior?
Artikkelin tykkääminen ilman kirjautumista aiheuttaa "Unhandled Rejection (TypeError): Cannot read property 'article' of null"- virheen.
What is the expected correct behavior?
Esim. popup, jossa lukee "To like this article, you need to have an account."
Relevant logs and/or screenshots
×
Unhandled Rejection (TypeError): Cannot read property 'article' of null
(anonymous function)
src/app/src/reducers/articleList.js:22
19 | return {
20 | ...state,
21 | articles: state.articles.map(article => {
> 22 | if (article.slug === action.payload.article.slug) {
23 | return {
24 | ...article,
25 | favorited: action.payload.article.favorited,
View compiled
(anonymous function)
src/app/src/reducers/articleList.js:21
18 | case ARTICLE_UNFAVORITED:
19 | return {
20 | ...state,
> 21 | articles: state.articles.map(article => {
22 | if (article.slug === action.payload.article.slug) {
23 | return {
24 | ...article,
View compiled
▶ 3 stack frames were collapsed.
(anonymous function)
src/app/src/middleware.js:60
57 | agent.setToken(null);
58 | }
59 |
> 60 | next(action);
61 | };
62 |
63 | function isPromise(v) {
View compiled
(anonymous function)
src/app/src/middleware.js:46
43 | return;
44 | }
45 |
> 46 | next(action);
47 | };
48 |
49 | const localStorageMiddleware = store => next => action => {
View compiled
▶ 2 stack frames were collapsed.
(anonymous function)
src/app/src/middleware.js:39
36 | if (!action.skipTracking) {
37 | store.dispatch({ type: ASYNC_END, promise: action.payload });
38 | }
> 39 | store.dispatch(action);
40 | }
41 | );
42 |
View compiled
This screen is visible only in development. It will not appear if the app crashes in production.
Open your browser’s developer console to further inspect this error.