fix: State problem when not changing emote name
This commit is contained in:
parent
ed945311d9
commit
b625249ff8
2 changed files with 2 additions and 3 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue