Skip to content
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

fix: Some errors were not showing, appeal popup not closing #83

Merged
merged 3 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api/src/main/java/com/rappytv/globaltags/api/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import com.rappytv.globaltags.wrapper.http.ApiHandler.ApiResponse;
import java.util.UUID;
import net.labymod.api.Laby;
import net.labymod.api.client.component.Component;
import net.labymod.api.client.component.format.NamedTextColor;
import net.labymod.api.client.gui.screen.widget.widgets.popup.SimpleAdvancedPopup;
import net.labymod.api.labyconnect.LabyConnectSession;
import net.labymod.api.notification.Notification;
import net.labymod.api.notification.Notification.Type;
import java.util.UUID;

public class Util {

Expand Down Expand Up @@ -73,7 +73,7 @@ public static void notify(Component title, Component description) {

public static Component getResponseComponent(ApiResponse<String> response) {
return Component.text(
response.getData(),
response.isSuccessful() ? response.getData() : response.getError(),
response.isSuccessful() ? NamedTextColor.GREEN : NamedTextColor.RED
);
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {

val versions = providers.gradleProperty("net.labymod.minecraft-versions").get().split(";")
group = "org.example"
version = providers.environmentVariable("VERSION").getOrElse("1.3.5")
version = providers.environmentVariable("VERSION").getOrElse("1.3.6")

labyMod {
defaultPackageName = "com.rappytv.globaltags" //change this to your main package name (used by all modules)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public AppealPopup(GlobalTagAPI api) {
))
.addId("send-button", "popup-description");
sendButton.setEnabled(false);
sendButton.setActionListener(() ->
sendButton.setActionListener(() -> {
this.api.getApiHandler().appealBan(inputWidget.getText(), (response) ->
Util.notify(
Component.translatable(response.isSuccessful()
Expand All @@ -48,8 +48,9 @@ public AppealPopup(GlobalTagAPI api) {
),
Component.text(response.getData(), NamedTextColor.WHITE)
)
)
);
);
this.close();
});
inputWidget.updateListener((text) -> sendButton.setEnabled(!text.isBlank()));

content.addChild(labelWidget);
Expand Down
Loading