fix: don't save if profile deleted
This commit is contained in:
parent
cc1dd4f766
commit
0bc9cd5fa2
1 changed files with 8 additions and 2 deletions
|
|
@ -107,7 +107,7 @@ public class EditProfileScreen extends Screen {
|
||||||
.withStyle(ChatFormatting.RED),
|
.withStyle(ChatFormatting.RED),
|
||||||
(button) -> {
|
(button) -> {
|
||||||
Profiles.deleteProfile(profileName.getString());
|
Profiles.deleteProfile(profileName.getString());
|
||||||
this.onClose();
|
this.onClose(true);
|
||||||
})
|
})
|
||||||
.width(50)
|
.width(50)
|
||||||
.build(),
|
.build(),
|
||||||
|
|
@ -122,7 +122,13 @@ public class EditProfileScreen extends Screen {
|
||||||
this.layout.arrangeElements();
|
this.layout.arrangeElements();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void onClose() {
|
public void onClose() {
|
||||||
|
this.onClose(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClose(boolean deleted) {
|
||||||
|
if (!deleted)
|
||||||
this.profileConfiguration.save();
|
this.profileConfiguration.save();
|
||||||
this.minecraft.setScreen(this.profilesScreen);
|
this.minecraft.setScreen(this.profilesScreen);
|
||||||
this.profilesScreen.profilesList.refreshEntries();
|
this.profilesScreen.profilesList.refreshEntries();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue