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),
|
||||
(button) -> {
|
||||
Profiles.deleteProfile(profileName.getString());
|
||||
this.onClose();
|
||||
this.onClose(true);
|
||||
})
|
||||
.width(50)
|
||||
.build(),
|
||||
|
|
@ -122,8 +122,14 @@ public class EditProfileScreen extends Screen {
|
|||
this.layout.arrangeElements();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose() {
|
||||
this.profileConfiguration.save();
|
||||
this.onClose(false);
|
||||
}
|
||||
|
||||
public void onClose(boolean deleted) {
|
||||
if (!deleted)
|
||||
this.profileConfiguration.save();
|
||||
this.minecraft.setScreen(this.profilesScreen);
|
||||
this.profilesScreen.profilesList.refreshEntries();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue