mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge branch 'omnivore-app:main' into main
This commit is contained in:
commit
90e8d5f5c5
9 changed files with 102 additions and 933 deletions
|
|
@ -19,8 +19,8 @@ android {
|
|||
applicationId "app.omnivore.omnivore"
|
||||
minSdk 26
|
||||
targetSdk 33
|
||||
versionCode 180
|
||||
versionName "0.0.180"
|
||||
versionCode 186
|
||||
versionName "0.0.186"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables {
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@ fun LibraryViewContent(libraryViewModel: LibraryViewModel, modifier: Modifier) {
|
|||
items = cardsData,
|
||||
key = { item -> item.savedItem.savedItemId }
|
||||
) { cardDataWithLabels ->
|
||||
val swipeThreshold = 0.40f
|
||||
val swipeThreshold = 0.45f
|
||||
|
||||
val currentThresholdFraction = remember { mutableStateOf(0f) }
|
||||
val currentItem by rememberUpdatedState(cardDataWithLabels.savedItem)
|
||||
|
|
@ -320,7 +320,7 @@ fun LibraryViewContent(libraryViewModel: LibraryViewModel, modifier: Modifier) {
|
|||
currentThresholdFraction.value < swipeThreshold ||
|
||||
currentThresholdFraction.value > 1.0f
|
||||
) {
|
||||
false
|
||||
return@rememberDismissState false
|
||||
}
|
||||
|
||||
if (it == DismissValue.DismissedToEnd) { // Archiving/UnArchiving.
|
||||
|
|
|
|||
|
|
@ -573,17 +573,17 @@ struct AnimatingCellHeight: AnimatableModifier {
|
|||
HStack {
|
||||
Menu(content: {
|
||||
Button(action: {
|
||||
viewModel.fetcher.updateFeatureFilter(context: dataService.viewContext, filter: .continueReading)
|
||||
viewModel.updateFeatureFilter(context: dataService.viewContext, filter: .continueReading)
|
||||
}, label: {
|
||||
Text("Continue Reading")
|
||||
})
|
||||
Button(action: {
|
||||
viewModel.fetcher.updateFeatureFilter(context: dataService.viewContext, filter: .pinned)
|
||||
viewModel.updateFeatureFilter(context: dataService.viewContext, filter: .pinned)
|
||||
}, label: {
|
||||
Text("Pinned")
|
||||
})
|
||||
Button(action: {
|
||||
viewModel.fetcher.updateFeatureFilter(context: dataService.viewContext, filter: .newsletters)
|
||||
viewModel.updateFeatureFilter(context: dataService.viewContext, filter: .newsletters)
|
||||
}, label: {
|
||||
Text("Newsletters")
|
||||
})
|
||||
|
|
@ -597,7 +597,7 @@ struct AnimatingCellHeight: AnimatableModifier {
|
|||
HStack(alignment: .center) {
|
||||
Image(systemName: "line.3.horizontal.decrease")
|
||||
.font(Font.system(size: 13, weight: .regular))
|
||||
Text((FeaturedItemFilter(rawValue: viewModel.fetcher.featureFilter) ?? .continueReading).title)
|
||||
Text((FeaturedItemFilter(rawValue: viewModel.featureFilter) ?? .continueReading).title)
|
||||
.font(Font.system(size: 13, weight: .medium))
|
||||
}
|
||||
.tint(Color(hex: "#007AFF"))
|
||||
|
|
@ -753,6 +753,9 @@ struct AnimatingCellHeight: AnimatableModifier {
|
|||
await viewModel.loadMore(dataService: dataService)
|
||||
}
|
||||
}
|
||||
|
||||
// reload this in case it was changed in settings
|
||||
viewModel.hideFeatureSection = UserDefaults.standard.bool(forKey: UserDefaultKey.hideFeatureSection.rawValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,8 @@ enum LoadingBarStyle {
|
|||
@AppStorage(UserDefaultKey.stopUsingFollowingPrimer.rawValue) var stopUsingFollowingPrimer = false
|
||||
@AppStorage("LibraryTabView::hideFollowingTab") var hideFollowingTab = false
|
||||
|
||||
@AppStorage(UserDefaultKey.lastSelectedFeaturedItemFilter.rawValue) var featureFilter = FeaturedItemFilter.continueReading.rawValue
|
||||
|
||||
@Published var appliedFilter: InternalFilter? {
|
||||
didSet {
|
||||
if let filterName = appliedFilter?.name.lowercased() {
|
||||
|
|
@ -363,4 +365,11 @@ enum LoadingBarStyle {
|
|||
snackbar("Error modifying emails")
|
||||
}
|
||||
}
|
||||
|
||||
func updateFeatureFilter(context: NSManagedObjectContext, filter: FeaturedItemFilter?) {
|
||||
if let filter = filter {
|
||||
featureFilter = filter.rawValue
|
||||
fetcher.updateFeatureFilter(context: context, filter: filter)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,14 @@
|
|||
var omnivoreWebURL: String
|
||||
@Property(title: "Omnivore deeplink URL")
|
||||
var omnivoreShortcutURL: String
|
||||
@Property(title: "Author if set")
|
||||
var author: String?
|
||||
@Property(title: "Site name if set")
|
||||
var siteName: String?
|
||||
@Property(title: "Published date if set")
|
||||
var publishedAt: Date?
|
||||
@Property(title: "Time the item was saved")
|
||||
var savedAt: Date?
|
||||
|
||||
init(item: Models.LibraryItem) {
|
||||
self.id = UUID(uuidString: item.unwrappedID)!
|
||||
|
|
@ -48,6 +56,10 @@
|
|||
self.originalURL = item.pageURLString
|
||||
self.omnivoreWebURL = "https://omnivore.app/me/\(item.slug!)"
|
||||
self.omnivoreShortcutURL = "omnivore://read/\(item.unwrappedID)"
|
||||
self.author = item.author
|
||||
self.siteName = item.siteName
|
||||
self.publishedAt = item.publishDate
|
||||
self.savedAt = item.savedAt
|
||||
}
|
||||
|
||||
static var typeDisplayRepresentation = TypeDisplayRepresentation(
|
||||
|
|
|
|||
|
|
@ -1,14 +1,20 @@
|
|||
{
|
||||
"extends": [
|
||||
"canonical",
|
||||
"canonical/node",
|
||||
"canonical/typescript"
|
||||
],
|
||||
"extends": "../../.eslintrc",
|
||||
"parserOptions": {
|
||||
"project": "./tsconfig.json"
|
||||
"project": "tsconfig.json"
|
||||
},
|
||||
"root": true,
|
||||
"rules": {
|
||||
"@typescript-eslint/no-parameter-properties": 0
|
||||
"semi": 0,
|
||||
"fp/no-class": 0,
|
||||
"prettier/prettier": 0,
|
||||
"@typescript-eslint/ban-types": 0,
|
||||
"@typescript-eslint/no-unsafe-call": 0,
|
||||
"@typescript-eslint/no-explicit-any": 0,
|
||||
"@typescript-eslint/no-inferrable-types": 0,
|
||||
"@typescript-eslint/no-unsafe-argument": 0,
|
||||
"@typescript-eslint/no-unsafe-member-access": 0,
|
||||
"@typescript-eslint/no-parameter-properties": 0,
|
||||
"@typescript-eslint/no-unsafe-assignment": 0,
|
||||
"@typescript-eslint/restrict-template-expressions": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,8 +28,6 @@
|
|||
"benny": "^3.7.1",
|
||||
"coveralls": "^3.1.1",
|
||||
"del-cli": "^4.0.1",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-canonical": "^28.0.0",
|
||||
"faker": "^5.5.3",
|
||||
"husky": "^7.0.4",
|
||||
"npm-watch": "^0.11.0",
|
||||
|
|
@ -67,4 +65,4 @@
|
|||
"volta": {
|
||||
"extends": "../../package.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,18 +1,14 @@
|
|||
/* eslint-disable fp/no-class */
|
||||
|
||||
import {
|
||||
ExtendableError,
|
||||
} from 'ts-error';
|
||||
import { ExtendableError } from 'ts-error'
|
||||
|
||||
export class LiqeError extends ExtendableError {}
|
||||
|
||||
export class SyntaxError extends LiqeError {
|
||||
public constructor (
|
||||
public constructor(
|
||||
public message: string,
|
||||
public offset: number,
|
||||
public line: number,
|
||||
public column: number,
|
||||
public column: number
|
||||
) {
|
||||
super(message);
|
||||
super(message)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue