[Glitch] Enable ESLlint no-case-declarations
Port f91f077985
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
af39ac6edc
commit
61a0c58dee
@ -106,12 +106,13 @@ export const connectTimelineStream = (timelineId, channelName, params = {}, opti
|
||||
dispatch(processNewNotificationForGroups(notificationJSON));
|
||||
break;
|
||||
}
|
||||
case 'notifications_merged':
|
||||
case 'notifications_merged': {
|
||||
const state = getState();
|
||||
if (state.notifications.top || !state.notifications.mounted)
|
||||
dispatch(expandNotifications({ forceLoad: true, maxId: undefined }));
|
||||
dispatch(refreshStaleNotificationGroups());
|
||||
break;
|
||||
}
|
||||
case 'conversation':
|
||||
// @ts-expect-error
|
||||
dispatch(updateConversations(JSON.parse(data.payload)));
|
||||
|
@ -41,7 +41,7 @@ const isLinkMisleading = (link) => {
|
||||
case Node.TEXT_NODE:
|
||||
linkTextParts.push(node.textContent);
|
||||
break;
|
||||
case Node.ELEMENT_NODE:
|
||||
case Node.ELEMENT_NODE: {
|
||||
if (node.classList.contains('invisible')) return;
|
||||
const children = node.childNodes;
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
@ -49,6 +49,7 @@ const isLinkMisleading = (link) => {
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
walk(link);
|
||||
|
@ -512,7 +512,7 @@ export default function compose(state = initialState, action) {
|
||||
|
||||
return item;
|
||||
}));
|
||||
case INIT_MEDIA_EDIT_MODAL:
|
||||
case INIT_MEDIA_EDIT_MODAL: {
|
||||
const media = state.get('media_attachments').find(item => item.get('id') === action.id);
|
||||
return state.set('media_modal', ImmutableMap({
|
||||
id: action.id,
|
||||
@ -521,6 +521,7 @@ export default function compose(state = initialState, action) {
|
||||
focusY: media.getIn(['meta', 'focus', 'y'], 0),
|
||||
dirty: false,
|
||||
}));
|
||||
}
|
||||
case COMPOSE_CHANGE_MEDIA_DESCRIPTION:
|
||||
return state.setIn(['media_modal', 'description'], action.description).setIn(['media_modal', 'dirty'], true);
|
||||
case COMPOSE_CHANGE_MEDIA_FOCUS:
|
||||
@ -575,7 +576,7 @@ export default function compose(state = initialState, action) {
|
||||
}));
|
||||
case COMPOSE_DOODLE_SET:
|
||||
return state.mergeIn(['doodle'], action.options);
|
||||
case REDRAFT:
|
||||
case REDRAFT: {
|
||||
const do_not_federate = !!action.status.get('local_only');
|
||||
let text = action.raw_text || unescapeHTML(expandMentions(action.status));
|
||||
if (do_not_federate) text = text.replace(/ ?👁\ufe0f?\u200b?$/, '');
|
||||
@ -616,6 +617,7 @@ export default function compose(state = initialState, action) {
|
||||
}));
|
||||
}
|
||||
});
|
||||
}
|
||||
case COMPOSE_SET_STATUS:
|
||||
return state.withMutations(map => {
|
||||
map.set('id', action.status.get('id'));
|
||||
|
@ -369,9 +369,10 @@ export default function notifications(state = initialState, action) {
|
||||
}
|
||||
return markAllForDelete(st, action.yes);
|
||||
|
||||
case NOTIFICATIONS_MARK_AS_READ:
|
||||
case NOTIFICATIONS_MARK_AS_READ: {
|
||||
const lastNotification = state.get('items').find(item => item !== null);
|
||||
return lastNotification ? recountUnread(state, lastNotification.get('id')) : state;
|
||||
}
|
||||
|
||||
default:
|
||||
return state;
|
||||
|
@ -72,9 +72,10 @@ export default function search(state = initialState, action) {
|
||||
});
|
||||
case SEARCH_EXPAND_REQUEST:
|
||||
return state.set('type', action.searchType).set('isLoading', true);
|
||||
case SEARCH_EXPAND_SUCCESS:
|
||||
case SEARCH_EXPAND_SUCCESS: {
|
||||
const results = action.searchType === 'hashtags' ? ImmutableOrderedSet(fromJS(action.results.hashtags)) : action.results[action.searchType].map(item => item.id);
|
||||
return state.updateIn(['results', action.searchType], list => list.union(results)).set('isLoading', false);
|
||||
}
|
||||
case SEARCH_HISTORY_UPDATE:
|
||||
return state.set('recent', ImmutableOrderedSet(fromJS(action.recent)));
|
||||
default:
|
||||
|
@ -17,7 +17,7 @@ const dropOrientationIfNeeded = (orientation) => new Promise(resolve => {
|
||||
case false:
|
||||
resolve(orientation);
|
||||
break;
|
||||
default:
|
||||
default: {
|
||||
// black 2x1 JPEG, with the following meta information set:
|
||||
// - EXIF Orientation: 6 (Rotated 90° CCW)
|
||||
const testImageURL =
|
||||
@ -39,6 +39,7 @@ const dropOrientationIfNeeded = (orientation) => new Promise(resolve => {
|
||||
};
|
||||
img.src = testImageURL;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Some browsers don't allow reading from a canvas and instead return all-white
|
||||
@ -52,7 +53,7 @@ const checkCanvasReliability = () => new Promise((resolve, reject) => {
|
||||
case false:
|
||||
resolve();
|
||||
break;
|
||||
default:
|
||||
default: {
|
||||
// 2×2 GIF with white, red, green and blue pixels
|
||||
const testImageURL =
|
||||
'data:image/gif;base64,R0lGODdhAgACAKEDAAAA//8AAAD/AP///ywAAAAAAgACAAACA1wEBQA7';
|
||||
@ -78,6 +79,7 @@ const checkCanvasReliability = () => new Promise((resolve, reject) => {
|
||||
};
|
||||
img.src = testImageURL;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const getImageUrl = inputFile => new Promise((resolve, reject) => {
|
||||
|
Loading…
Reference in New Issue
Block a user