mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
allow readingProgressAnchorIndex to be null
This commit is contained in:
parent
8712107a2f
commit
2e5529fd81
4 changed files with 5 additions and 5 deletions
|
|
@ -2093,7 +2093,7 @@ export enum SaveArticleReadingProgressErrorCode {
|
|||
|
||||
export type SaveArticleReadingProgressInput = {
|
||||
id: Scalars['ID'];
|
||||
readingProgressAnchorIndex: Scalars['Int'];
|
||||
readingProgressAnchorIndex?: InputMaybe<Scalars['Int']>;
|
||||
readingProgressPercent: Scalars['Float'];
|
||||
readingProgressTopPercent?: InputMaybe<Scalars['Float']>;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1572,7 +1572,7 @@ enum SaveArticleReadingProgressErrorCode {
|
|||
|
||||
input SaveArticleReadingProgressInput {
|
||||
id: ID!
|
||||
readingProgressAnchorIndex: Int!
|
||||
readingProgressAnchorIndex: Int
|
||||
readingProgressPercent: Float!
|
||||
readingProgressTopPercent: Float
|
||||
}
|
||||
|
|
|
|||
|
|
@ -581,7 +581,7 @@ export const saveArticleReadingProgressResolver = authorized<
|
|||
(readingProgressTopPercent &&
|
||||
(readingProgressTopPercent < 0 ||
|
||||
readingProgressTopPercent > readingProgressPercent)) ||
|
||||
readingProgressAnchorIndex < 0
|
||||
(readingProgressAnchorIndex && readingProgressAnchorIndex < 0)
|
||||
) {
|
||||
return { errorCodes: [SaveArticleReadingProgressErrorCode.BadData] }
|
||||
}
|
||||
|
|
@ -609,7 +609,7 @@ export const saveArticleReadingProgressResolver = authorized<
|
|||
readingProgressAnchorIndex === 0
|
||||
? 0
|
||||
: Math.max(
|
||||
readingProgressAnchorIndex,
|
||||
readingProgressAnchorIndex || 0,
|
||||
libraryItem.readingProgressHighestReadAnchor
|
||||
),
|
||||
readingProgressTopPercent: readingProgressTopPercentToSave,
|
||||
|
|
|
|||
|
|
@ -636,7 +636,7 @@ const schema = gql`
|
|||
id: ID!
|
||||
readingProgressTopPercent: Float
|
||||
readingProgressPercent: Float!
|
||||
readingProgressAnchorIndex: Int!
|
||||
readingProgressAnchorIndex: Int
|
||||
}
|
||||
enum SaveArticleReadingProgressErrorCode {
|
||||
NOT_FOUND
|
||||
|
|
|
|||
Loading…
Reference in a new issue