-
Notifications
You must be signed in to change notification settings - Fork 0
fix: Sharedwithyou #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,8 @@ const SET_IS_PENDING_STATE = "scratch-gui/vm-status/SET_IS_PENDING_STATE"; | |
const ADD_NOTIFICATION = "scratch-gui/vm-status/ADD_NOTIFICATION"; | ||
const REMOVE_NOTIFICATION = "scratch-gui/vm-status/REMOVE_NOTIFICATION"; | ||
const POSITION_MODAL = "scratch-gui/vm-status/POSITION_MODAL"; | ||
const SET_ISEDITABLE_PROJECT = "scratch-gui/vm-status/SET_ISEDITABLE_PROJECT"; | ||
|
||
|
||
const initialState = { | ||
running: false, | ||
|
@@ -38,6 +40,7 @@ const initialState = { | |
isPendingState: false, | ||
notifications: [], | ||
positionModal: false, | ||
isEditableProject: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The property To improve code clarity and maintainability, I strongly suggest renaming this property to something more descriptive, like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
}; | ||
|
||
const reducer = function (state, action) { | ||
|
@@ -121,6 +124,11 @@ const reducer = function (state, action) { | |
(n) => n.id !== action.id | ||
), | ||
}; | ||
case SET_ISEDITABLE_PROJECT: | ||
return { | ||
...state, | ||
isEditableProject: action.isEditableProject, | ||
} | ||
default: | ||
return state; | ||
} | ||
|
@@ -196,6 +204,13 @@ const setIsLoadingState = function (isLoading) { | |
}; | ||
}; | ||
|
||
const setIsEditable = function (isEditableProject) { | ||
return { | ||
type: SET_ISEDITABLE_PROJECT, | ||
isEditableProject: isEditableProject, | ||
}; | ||
} | ||
|
||
const setSpriteClickedState = function (spriteClicked) { | ||
return { | ||
type: SET_SPRITE_CLICKED_STATE, | ||
|
@@ -275,4 +290,5 @@ export { | |
removeNotification, | ||
greenFlagClicked, | ||
setPositionModal, | ||
setIsEditable, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
opacity: 1
in the inline style is redundant, as it's the default value for opacity. You can safely remove it to make the code a bit cleaner. This also applies to the same pattern on lines 462 and 465.