Do not disable networking buttons if hasNetworkConnection is false

This commit is contained in:
Angelo Stavrow 2020-10-16 17:35:02 -04:00
parent 3ebfa7a0d1
commit a289e544b1
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE
3 changed files with 4 additions and 11 deletions

View File

@ -43,7 +43,7 @@ struct PostListView: View {
}, label: {
Image(systemName: "arrow.clockwise")
})
.disabled(!model.account.isLoggedIn || !model.hasNetworkConnection)
.disabled(!model.account.isLoggedIn)
}
}
.padding()
@ -70,7 +70,7 @@ struct PostListView: View {
}, label: {
Image(systemName: "arrow.clockwise")
})
.disabled(!model.account.isLoggedIn || !model.hasNetworkConnection)
.disabled(!model.account.isLoggedIn)
}
#endif
}

View File

@ -195,12 +195,7 @@ struct PostEditorView: View {
}, label: {
Label("Publish", systemImage: "paperplane")
})
.disabled(
post.status ==
PostStatus.published.rawValue ||
!model.hasNetworkConnection ||
post.body.count == 0
)
.disabled(post.status == PostStatus.published.rawValue || post.body.count == 0)
}
Button(action: {
sharePost()

View File

@ -143,9 +143,7 @@ struct PostEditorView: View {
}, label: {
Image(systemName: "paperplane")
})
.disabled(
post.status == PostStatus.published.rawValue || !model.hasNetworkConnection || post.body.count == 0
)
.disabled(post.status == PostStatus.published.rawValue || || post.body.count == 0)
}
}
.onChange(of: post.hasNewerRemoteCopy, perform: { _ in