Skip to content

Commit

Permalink
Merge pull request #2900 from omnivore-app/fix/web/continue-reading
Browse files Browse the repository at this point in the history
update the filter value to use is:reading of the Continue Reading filter
  • Loading branch information
sywhb authored Oct 11, 2023
2 parents 29c8786 + dc14743 commit aef6bf5
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 6 deletions.
5 changes: 4 additions & 1 deletion packages/api/src/services/create_user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ const createDefaultFiltersForUser =
async (userId: string): Promise<Filter[]> => {
const defaultFilters = [
{ name: 'Inbox', filter: 'in:inbox' },
{ name: 'Continue Reading', filter: 'in:inbox sort:read-desc is:unread' },
{
name: 'Continue Reading',
filter: 'in:inbox sort:read-desc is:reading',
},
{ name: 'Non-Feed Items', filter: 'in:library' },
{ name: 'Highlights', filter: 'has:highlights mode:highlights' },
{ name: 'Unlabeled', filter: 'no:label' },
Expand Down
8 changes: 4 additions & 4 deletions packages/db/elastic_migrations/migrate_from_elastic.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ async def main():
ES_USERNAME, ES_PASSWORD), retry_on_timeout=True)

try:
updated_user_ids = []
# updated_user_ids = []

print(await es_client.info())

Expand Down Expand Up @@ -454,8 +454,8 @@ async def main():
library_items.append(library_item)
library_items_original_ids.append(doc_id)

if user_id not in updated_user_ids:
updated_user_ids.append(user_id)
# if user_id not in updated_user_ids:
# updated_user_ids.append(user_id)

# convert labels to postgres format
if 'labels' in source:
Expand Down Expand Up @@ -551,7 +551,7 @@ async def main():

print('Migration complete', END_TIME)

await assert_data(db_conn, es_client, updated_user_ids, uploaded_files)
# await assert_data(db_conn, es_client, updated_user_ids, uploaded_files)
except Exception as err:
print('Migration error', err)
finally:
Expand Down
11 changes: 11 additions & 0 deletions packages/db/migrations/0130.do.update_continue_reading_filter.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- Type: DO
-- Name: update_continue_reading_filter
-- Description: Update the filter value in the Continue Reading filter

BEGIN;

UPDATE omnivore.filters
SET filter = 'in:inbox sort:read-desc is:reading'
WHERE name = 'Continue Reading' AND default_filter = true;

COMMIT;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- Type: UNDO
-- Name: update_continue_reading_filter
-- Description: Update the filter value in the Continue Reading filter

BEGIN;

UPDATE omnivore.filters
SET filter = 'in:inbox sort:read-desc is:unread'
WHERE name = 'Continue Reading' AND default_filter = true;

COMMIT;
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export const EmptyLibrary = (props: EmptyLibraryProps) => {
switch (props.searchTerm) {
case 'in:inbox':
return 'inbox'
case 'in:inbox sort:read-desc is:unread':
case 'in:inbox sort:read-desc is:reading':
return 'continue'
case 'in:library':
return 'non-feed'
Expand Down

1 comment on commit aef6bf5

@vercel
Copy link

@vercel vercel bot commented on aef6bf5 Oct 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.