react-native-readium 4.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,24 +35,20 @@ class ReadiumView(
35
35
  }
36
36
 
37
37
  fun updatePreferencesFromJsonString(preferences: String?) {
38
- if (preferences == null) {
39
- return
40
- } else if (fragment == null) {
41
- lateInitSerializedUserPreferences = preferences
38
+ lateInitSerializedUserPreferences = preferences
39
+ if (preferences == null || fragment == null) {
42
40
  return
43
41
  }
44
42
 
45
43
  if (fragment is EpubReaderFragment) {
46
44
  (fragment as EpubReaderFragment).updatePreferencesFromJsonString(preferences)
47
45
  }
48
-
49
- lateInitSerializedUserPreferences = null
50
46
  }
51
47
 
52
48
  fun addFragment(frag: BaseReaderFragment) {
53
49
  fragment = frag
54
50
  setupLayout()
55
- updatePreferencesFromJsonString(lateInitSerializedUserPreferences)
51
+ lateInitSerializedUserPreferences?.let { updatePreferencesFromJsonString(it)}
56
52
  val activity: FragmentActivity? = reactContext.currentActivity as FragmentActivity?
57
53
  activity!!.supportFragmentManager
58
54
  .beginTransaction()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-readium",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "A react-native wrapper for https://readium.org/",
5
5
  "main": "lib/src/index",
6
6
  "types": "lib/src/index.d.ts",