Skip to content

Commit

Permalink
Current pattern on UI now decreases when the viewed one is removed
Browse files Browse the repository at this point in the history
  • Loading branch information
shillinc-osu committed May 24, 2024
1 parent 5c711aa commit 1e0cf9a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion WebApp/size-plugin.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions WebApp/src/components/strip_settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ const StripSettings = ({patterns}) => {
*/
const decrementPatterns = async () => {
if(data.pattern_count > 1){
if(data.pattern_count == selectedPattern + 1){
setPattern(data.pattern_count - 1);
}
update("pattern_count", data.pattern_count - 1);
if(data.pattern_count >= selectedPattern - 1){
setPattern(data.pattern_count - 2);
}
}
}

Expand Down

0 comments on commit 1e0cf9a

Please sign in to comment.