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: Correctly handle setting / editing a status' language #780

Merged
merged 2 commits into from
Jun 25, 2024

Conversation

nikclayton
Copy link
Contributor

@nikclayton nikclayton commented Jun 25, 2024

Previous code set the initial status text, and then set up the callbacks which meant that the status' length was initially 0, even when editing a status.

This meant that, e.g., editing a status to change its language would erroneously report the status body was empty. It also meant that editing a status and changing just the language would not prompt to save or discard the changes if moving back.

Fix this.

First, only set the status content after the callbacks that compute the status length.

Second, provide a function that sets the status' language, and update the close confirmation state when the language changes. Modify isDirty() to compare the original and current language when determining if the status is dirty.

Fixes #701

Previous code set the initial status text, and then set up the callbacks
which meant that the status' length was initially 0, even when editing
a status.

This meant that, e.g., editing a status to change its language would
erroneously report the status body was empty. It also meant that editing
a status and changing just the language would not prompt to save or
discard the changes if moving back.

Fix this.

First, only set the status content after the callbacks that compute the
status length.

Second, provide a function that sets the status' language, and update
the close confirmation state when the language changes. Modify isDirty()
to compare the original and current language when determining if the
status is dirty.
@nikclayton nikclayton merged commit 04b7ce4 into main Jun 25, 2024
23 checks passed
@nikclayton nikclayton deleted the update-status-length branch June 25, 2024 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editing reply incorrectly fails to save
1 participant