Merge pull request #3303 from omnivore-app/fix/default-highlights-query

Update the default Highlights query
This commit is contained in:
Jackson Harper 2024-01-04 15:14:39 +08:00 committed by GitHub
commit 5cdea05a37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 1 deletions

View file

@ -160,7 +160,7 @@ const createDefaultFiltersForUser =
filter: 'in:inbox sort:read-desc is:reading',
},
{ name: 'Non-Feed Items', filter: 'no:subscription' },
{ name: 'Highlights', filter: 'has:highlights mode:highlights' },
{ name: 'Highlights', filter: 'in:all has:highlights mode:highlights' },
{ name: 'Unlabeled', filter: 'no:label' },
{ name: 'Oldest First', filter: 'sort:saved-asc' },
{ name: 'Files', filter: 'type:file' },

View file

@ -0,0 +1,12 @@
-- Type: DO
-- Name: update_highlights_saved_search
-- Description: Update highlights saved search to use all instead of inbox
BEGIN;
UPDATE omnivore.filters
SET filter = 'in:all has:highlights mode:highlights'
WHERE name = 'Highlights'
AND filter = 'has:highlights mode:highlights' ;
COMMIT;

View file

@ -0,0 +1,12 @@
-- Type: UNDO
-- Name: update_highlights_saved_search
-- Description: Update highlights saved search to use all instead of inbox
BEGIN;
UPDATE omnivore.filters
SET filter = 'has:highlights mode:highlights'
WHERE name = 'Highlights'
AND filter = 'in:all has:highlights mode:highlights' ;
COMMIT;

View file

@ -171,7 +171,9 @@ export const EmptyLibrary = (props: EmptyLibraryProps) => {
return 'continue'
case 'no:subscription':
return 'non-feed'
// Handle both cases while we migrate
case 'has:highlights mode:highlights':
case 'in:all has:highlights mode:highlights':
return 'highlight'
case 'no:label':
return 'unlabeled'