wordpress-mobile / AztecEditor-Android

A reusable native Android rich text editor component.
Mozilla Public License 2.0
700 stars 115 forks source link

Don't report changes for empty text #1046

Closed nbradbury closed 1 year ago

nbradbury commented 1 year ago

Fixes #1045

Currently hasChanges returns CHANGES when it is first opened, before any changes have been made. This happens because the comparison relies on initialEditorContentParsedSHA256, which is initialized as an empty array - which doesn't match the hash of an empty string.

The PR resolves that problem.

nbradbury commented 1 year ago

We decided to close this because although the fix is good for Day One, we're not 100% sure it's the behavior WordPress wants.