From 9dc1f7d29941865f27734d11b0f52c49c095dbcf Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 29 Jan 2020 16:18:33 +0100 Subject: [Glitch] Fix mascot being too large, and a code style issue Port bba0269d9741c8c4daaa9048c265a1321d93fbba to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/reducers/statuses.js | 3 +-- app/javascript/flavours/glitch/styles/components/drawer.scss | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/reducers/statuses.js b/app/javascript/flavours/glitch/reducers/statuses.js index ee8ac929d..8926e49f1 100644 --- a/app/javascript/flavours/glitch/reducers/statuses.js +++ b/app/javascript/flavours/glitch/reducers/statuses.js @@ -41,8 +41,7 @@ export default function statuses(state = initialState, action) { case FAVOURITE_REQUEST: return state.setIn([action.status.get('id'), 'favourited'], true); case UNFAVOURITE_SUCCESS: - const favouritesCount = action.status.get('favourites_count'); - return state.setIn([action.status.get('id'), 'favourites_count'], favouritesCount - 1); + return state.updateIn([action.status.get('id'), 'favourites_count'], x => Math.max(0, x - 1)); case FAVOURITE_FAIL: return state.get(action.status.get('id')) === undefined ? state : state.setIn([action.status.get('id'), 'favourited'], false); case BOOKMARK_REQUEST: diff --git a/app/javascript/flavours/glitch/styles/components/drawer.scss b/app/javascript/flavours/glitch/styles/components/drawer.scss index 93a3f62ed..d5463e406 100644 --- a/app/javascript/flavours/glitch/styles/components/drawer.scss +++ b/app/javascript/flavours/glitch/styles/components/drawer.scss @@ -210,7 +210,7 @@ display: block; object-fit: contain; object-position: bottom left; - width: 100%; + width: 85%; height: 100%; pointer-events: none; user-drag: none; -- cgit