mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #2114 from omnivore-app/fix/android-highlight-loading
Set type on highlight objects so they are properly loaded
This commit is contained in:
commit
29da91e760
12 changed files with 15 additions and 6 deletions
|
|
@ -17,8 +17,8 @@ android {
|
|||
applicationId "app.omnivore.omnivore"
|
||||
minSdk 26
|
||||
targetSdk 33
|
||||
versionCode 44
|
||||
versionName "0.0.44"
|
||||
versionCode 46
|
||||
versionName "0.0.46"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -45,6 +45,7 @@ fragment ArticleFields on Article {
|
|||
|
||||
fragment HighlightFields on Highlight {
|
||||
id
|
||||
type
|
||||
shortId
|
||||
quote
|
||||
prefix
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ suspend fun DataService.createWebHighlight(jsonString: String) {
|
|||
|
||||
withContext(Dispatchers.IO) {
|
||||
val highlight = Highlight(
|
||||
type = "HIGHLIGHT",
|
||||
highlightId = createHighlightInput.id,
|
||||
shortId = createHighlightInput.shortId,
|
||||
quote = createHighlightInput.quote.getOrNull(),
|
||||
|
|
|
|||
|
|
@ -113,6 +113,7 @@ suspend fun DataService.sync(since: String, cursor: String?, limit: Int = 20): S
|
|||
it.highlights ?: listOf()
|
||||
}.map {
|
||||
Highlight(
|
||||
type = it.highlightFields.type.toString(),
|
||||
highlightId = it.highlightFields.id,
|
||||
annotation = it.highlightFields.annotation,
|
||||
createdByMe = it.highlightFields.createdByMe,
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@ suspend fun Networker.createHighlight(input: CreateHighlightInput): Highlight? {
|
|||
// val updatedAtString = createdHighlight.highlightFields.updatedAt as? String
|
||||
|
||||
return Highlight(
|
||||
type = createdHighlight.highlightFields.type.toString(),
|
||||
highlightId = createdHighlight.highlightFields.id,
|
||||
shortId = createdHighlight.highlightFields.shortId,
|
||||
quote = createdHighlight.highlightFields.quote,
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ suspend fun Networker.savedItem(slug: String): SavedItemQueryResponse {
|
|||
|
||||
Highlight(
|
||||
highlightId = it.highlightFields.id,
|
||||
type = it.highlightFields.type.toString(),
|
||||
shortId = it.highlightFields.shortId,
|
||||
quote = it.highlightFields.quote,
|
||||
prefix = it.highlightFields.prefix,
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ suspend fun Networker.search(
|
|||
highlights = (it.node.highlights ?: listOf()).map { highlight ->
|
||||
Highlight(
|
||||
highlightId = highlight.highlightFields.id,
|
||||
type = highlight.highlightFields.type.toString(),
|
||||
annotation = highlight.highlightFields.annotation,
|
||||
createdByMe = highlight.highlightFields.createdByMe,
|
||||
patch = highlight.highlightFields.patch,
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import app.omnivore.omnivore.persistence.entities.*
|
|||
SavedItemAndSavedItemLabelCrossRef::class,
|
||||
SavedItemAndHighlightCrossRef::class
|
||||
],
|
||||
version = 5
|
||||
version = 6
|
||||
)
|
||||
abstract class AppDatabase : RoomDatabase() {
|
||||
abstract fun viewerDao(): ViewerDao
|
||||
|
|
|
|||
|
|
@ -2,11 +2,14 @@ package app.omnivore.omnivore.persistence.entities
|
|||
|
||||
import androidx.room.*
|
||||
import app.omnivore.omnivore.models.ServerSyncStatus
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
|
||||
@Entity
|
||||
data class Highlight(
|
||||
@SerializedName("id")
|
||||
@PrimaryKey val highlightId: String,
|
||||
val type: String,
|
||||
var annotation: String?,
|
||||
val createdAt: String?,
|
||||
val createdByMe: Boolean,
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -4,7 +4,7 @@
|
|||
"private": true,
|
||||
"scripts": {
|
||||
"build": "webpack --mode production",
|
||||
"build-and-update": "yarn build && cp build/bundle.js ../../apple/OmnivoreKit/Sources/Views/Resources/bundle.js"
|
||||
"build-and-update": "yarn build && cp build/bundle.js ../../apple/OmnivoreKit/Sources/Views/Resources/bundle.js && cp build/bundle.js ../../android/Omnivore/app/src/main/assets/bundle.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@omnivore/web": "1.0.0"
|
||||
|
|
|
|||
Loading…
Reference in a new issue