Skip to content
This repository was archived by the owner on Jan 23, 2019. It is now read-only.

Commit d958d21

Browse files
committed
Fix caching bug causing some strings to be lost (closes #113)
getTag() would cache the result, but after setting a string to empty content, the cached result wouldn't be invalidated. This caused some operations to update the contents of a now ghost tag, hence losing the changes when updating the cache.
1 parent 6aa90cf commit d958d21

File tree

1 file changed

+2
-0
lines changed
  • src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/resources

1 file changed

+2
-0
lines changed

src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/resources/Resources.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ void loadTag(ResTag rt) {
218218

219219
public void deleteId(String resourceId) {
220220
mStrings.remove(resourceId);
221+
if (mLastTag != null && mLastTag.getId().equals(resourceId))
222+
mLastTag = null;
221223
}
222224

223225
//endregion

0 commit comments

Comments
 (0)