fix: State problem when not changing emote name

This commit is contained in:
krille-chan 2025-11-20 19:24:15 +01:00
parent ed945311d9
commit b625249ff8
No known key found for this signature in database
2 changed files with 2 additions and 3 deletions

View file

@ -135,11 +135,12 @@ class EmotesSettingsController extends State<EmotesSettings> {
void submitImageAction(
String oldImageCode,
String imageCode,
ImagePackImageContent image,
TextEditingController controller,
) {
controller.text = controller.text.trim().replaceAll(' ', '-');
final imageCode = controller.text;
if (imageCode == oldImageCode) return;
if (pack!.images.keys.any((k) => k == imageCode && k != oldImageCode)) {
controller.text = oldImageCode;
showOkAlertDialog(

View file

@ -135,7 +135,6 @@ class EmotesSettingsView extends StatelessWidget {
onInvoke: (i) {
controller.submitImageAction(
imageCode,
textEditingController.text,
image,
textEditingController,
);
@ -165,7 +164,6 @@ class EmotesSettingsView extends StatelessWidget {
onSubmitted: (s) =>
controller.submitImageAction(
imageCode,
s,
image,
textEditingController,
),