Exclude local posts from showing remote-copy-deleted prompt

This commit is contained in:
Angelo Stavrow 2020-09-21 11:45:36 -04:00
parent 58e2aff6d7
commit 4c9f5d3348
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE
2 changed files with 16 additions and 3 deletions

View File

@ -56,7 +56,7 @@ struct PostEditorStatusToolbarView: View {
})
}
#endif
} else if post.wasDeletedFromServer {
} else if post.wasDeletedFromServer && post.status != PostStatus.local.rawValue {
#if os(iOS)
if horizontalSizeClass == .compact {
VStack {
@ -137,3 +137,16 @@ struct PESTView_OutdatedLocalCopyPreviews: PreviewProvider {
.environmentObject(model)
}
}
struct PESTView_DeletedRemoteCopyPreviews: PreviewProvider {
static var previews: some View {
let context = LocalStorageManager.persistentContainer.viewContext
let model = WriteFreelyModel()
let testPost = WFAPost(context: context)
testPost.status = PostStatus.published.rawValue
testPost.wasDeletedFromServer = true
return PostEditorStatusToolbarView(post: testPost)
.environmentObject(model)
}
}

View File

@ -7,12 +7,12 @@
<key>WriteFreely-MultiPlatform (iOS).xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
<key>WriteFreely-MultiPlatform (macOS).xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
</dict>
</dict>