Skip to content

Commit

Permalink
misc clean up and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielrindlaub committed Feb 1, 2022
1 parent ae7cb6e commit df2894e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/features/images/ImagesPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { styled } from '../../theme/stitches.config.js';
import { selectWorkingImages } from '../review/reviewSlice';
import {
fetchImages,
selectImages,
selectHasNext,
selectIsLoading,
selectPaginatedField,
Expand Down
3 changes: 2 additions & 1 deletion src/features/images/imagesSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { IMAGE_QUERY_LIMITS } from '../../config';
import { DATE_FORMAT_EXIF as EXIF } from '../../config';

const initialState = {
images: [],
images: [], // we are barely using this... consider removing?
isLoading: false,
isUpdatingObjects: false,
isEditingLabel: false,
Expand Down Expand Up @@ -80,6 +80,7 @@ export const imagesSlice = createSlice({
state.visibleRows = payload;
},

// NOTE: not using updateObject anymore
updateObjectsStart: (state) => { state.isUpdatingObjects = true; },

updateObjectsFailure: (state, { payload }) => {
Expand Down
5 changes: 4 additions & 1 deletion src/features/loupe/BoundingBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@ const BoundingBox = ({
onMouseEnter={handleBBoxHover}
onMouseLeave={handleBBoxMouseLeave}
selected={objectFocused}
css={{ borderColor: labelColor.primary }}
css={{
borderColor: labelColor.primary,
background: labelColor.primary + '0D',
}}
>
{label &&
<BoundingBoxLabel
Expand Down
7 changes: 1 addition & 6 deletions src/features/loupe/LoupeFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import IconButton from '../../components/IconButton';
import { selectUserUsername } from '../user/userSlice';
import { selectImagesCount } from '../images/imagesSlice';
import { selectIsAddingLabel, selectReviewMode } from './loupeSlice';
import {
labelValidated,
incrementFocusIndex,
incrementImage,
selectFocusIndex,
} from '../review/reviewSlice';
import {
selectIsAddingLabel,
selectReviewMode
} from './loupeSlice';
import { validateSDL } from 'graphql/validation/validate';

const IndexDisplay = styled('div', {
fontFamily: '$mono',
Expand Down
3 changes: 3 additions & 0 deletions src/features/review/reviewSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ export const reviewSlice = createSlice({
state.workingImages = [];
})
.addCase(updateObjectsSuccess, (state, { payload }) => {
// TODO: we don't use updateObject anymore, so this isn't doing anything
// consider pushing returned images from editLabelSuccess into
// working images instead?
const imgId = payload.updateObjects.image._id;
const newObjects = payload.updateObjects.image.objects;
const image = state.workingImages.find(img => img._id === imgId);
Expand Down

0 comments on commit df2894e

Please sign in to comment.