]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fix mascot being too large, and a code style issue
authorEugen Rochko <eugen@zeonfederated.com>
Wed, 29 Jan 2020 15:18:33 +0000 (16:18 +0100)
committerThibaut Girka <thib@sitedethib.com>
Mon, 3 Feb 2020 08:27:51 +0000 (09:27 +0100)
Port bba0269d9741c8c4daaa9048c265a1321d93fbba to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
app/javascript/flavours/glitch/reducers/statuses.js
app/javascript/flavours/glitch/styles/components/drawer.scss

index ee8ac929d7d113760e5c674f0f217466ece3661d..8926e49f1cfdb3cbf588af1577ea3948746160c0 100644 (file)
@@ -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:
index 93a3f62ed32a5d2c6d0d38a56598e506c464b638..d5463e4068433c180aa22ccbb68feef09f3a6433 100644 (file)
     display: block;
     object-fit: contain;
     object-position: bottom left;
-    width: 100%;
+    width: 85%;
     height: 100%;
     pointer-events: none;
     user-drag: none;