Skip to content

Commit

Permalink
Fix MenuComponent for modals
Browse files Browse the repository at this point in the history
  • Loading branch information
MineKing9534 committed Jan 2, 2024
1 parent 6245905 commit e6f94e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group = 'de.mineking'
version = '3.6.5'
version = '3.6.6'

var commit = getCommit()
var release = System.getenv("RELEASE") == "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import de.mineking.discordutils.ui.components.button.label.EmojiLabel;
import de.mineking.discordutils.ui.components.button.label.LabelProvider;
import de.mineking.discordutils.ui.components.button.label.TextLabel;
import de.mineking.discordutils.ui.modal.ModalMenu;
import de.mineking.discordutils.ui.state.DataState;
import de.mineking.discordutils.ui.state.SendState;
import de.mineking.discordutils.ui.state.UpdateState;
Expand All @@ -30,7 +31,7 @@ public MenuComponent(@NotNull T menu, @NotNull Function<DataState<MessageMenu>,
super(menu.id, color, label);

appendHandler(state -> state.getEvent().ifPresent(event -> {
if(event instanceof IMessageEditCallback edit) edit.deferEdit().queue();
if(event instanceof IMessageEditCallback edit && !(menu instanceof ModalMenu)) edit.deferEdit().queue();
if(event instanceof GenericComponentInteractionCreateEvent ce) creator.apply(menu, state).display(ce);
}));
}
Expand Down

0 comments on commit e6f94e0

Please sign in to comment.