Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offline Mode: Fix incorrect predicates used when syncPublishing is off #23176

Merged
merged 2 commits into from
May 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions WordPress/Classes/ViewRelated/Post/PostListFilter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ import Foundation
let statuses: [BasePost.Status] = [.publish, .publishPrivate]

let predicate: NSPredicate
if FeatureFlag.syncPublishing.enabled {
if !FeatureFlag.syncPublishing.enabled {
let query =
// existing published/private posts
"(statusAfterSync = status AND status IN (%@))"
Expand Down Expand Up @@ -128,7 +128,7 @@ import Foundation
let statusesForLocalDrafts: [BasePost.Status] = [.draft, .pending, .publish, .publishPrivate, .scheduled]

let predicate: NSPredicate
if FeatureFlag.syncPublishing.enabled {
if !FeatureFlag.syncPublishing.enabled {
let query =
// Existing draft/pending posts
"(statusAfterSync = status AND status IN (%@))"
Expand Down Expand Up @@ -170,7 +170,7 @@ import Foundation
let statuses: [BasePost.Status] = [.scheduled]

let predicate: NSPredicate
if FeatureFlag.syncPublishing.enabled {
if !FeatureFlag.syncPublishing.enabled {
let query =
// existing scheduled posts
"(statusAfterSync = status AND status IN (%@))"
Expand Down Expand Up @@ -213,7 +213,7 @@ import Foundation
let statuses: [BasePost.Status] = [.draft, .pending, .publish, .publishPrivate, .scheduled]

let predicate: NSPredicate
if FeatureFlag.syncPublishing.enabled {
if !FeatureFlag.syncPublishing.enabled {
let query =
// Existing non-trashed posts
"(statusAfterSync = status AND status IN (%@))"
Expand Down
Loading