Skip to content

Commit df351b5

Browse files
authored
Merge pull request #19761 from wordpress-mobile/fix/19157-TransactionTooLargeException2
Follow up: Replaces bundle usage in the editor with a local database
2 parents ddad2ae + 9a47820 commit df351b5

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

WordPress/src/main/java/org/wordpress/android/ui/history/HistoryDetailFragment.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ class HistoryDetailFragment : Fragment() {
1919
super.onCreate(savedInstanceState)
2020

2121
mRevision = if (getDatabase(WordPress.getContext())?.hasParcel(KEY_REVISION) == true) {
22-
getDatabase(WordPress.getContext())?.getParcel(KEY_REVISION, parcelableCreator<Revision>())
22+
getDatabase(WordPress.getContext())?.getParcel(KEY_REVISION, parcelableCreator())
2323
} else {
24-
getDatabase(WordPress.getContext())?.getParcel(EXTRA_REVISION, parcelableCreator<Revision>())
24+
getDatabase(WordPress.getContext())?.getParcel(EXTRA_REVISION, parcelableCreator())
2525
}
2626
}
2727

libs/editor/src/main/java/org/wordpress/android/editor/savedinstance/SavedInstanceDatabase.kt

+6-6
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,21 @@ class SavedInstanceDatabase(context: Context?) : SQLiteOpenHelper(context, DB_NA
6464
private const val DB_NAME = "wpsavedinstance.db"
6565
private const val DB_VERSION = 1
6666

67-
private var mSavedInstanceDb: SavedInstanceDatabase? = null
67+
private var savedInstanceDb: SavedInstanceDatabase? = null
6868
private val DB_LOCK = Any()
6969

7070
fun getDatabase(context: Context): SavedInstanceDatabase? {
71-
if (mSavedInstanceDb == null) {
71+
if (savedInstanceDb == null) {
7272
synchronized(DB_LOCK) {
73-
if (mSavedInstanceDb == null) {
74-
mSavedInstanceDb = SavedInstanceDatabase(context.applicationContext)
73+
if (savedInstanceDb == null) {
74+
savedInstanceDb = SavedInstanceDatabase(context.applicationContext)
7575
// this ensures that onOpen() is called with a writable database
7676
// (open will fail if app calls getReadableDb() first)
77-
mSavedInstanceDb?.writableDatabase
77+
savedInstanceDb?.writableDatabase
7878
}
7979
}
8080
}
81-
return mSavedInstanceDb
81+
return savedInstanceDb
8282
}
8383
}
8484
}

0 commit comments

Comments
 (0)