Hide language buttons again if page is empty
This commit is contained in:
parent
268ab205b5
commit
1537aaab01
@ -473,7 +473,7 @@ extension Element {
|
|||||||
*/
|
*/
|
||||||
private func existingContentUrl(for language: String) -> URL? {
|
private func existingContentUrl(for language: String) -> URL? {
|
||||||
let url = contentUrl(for: language)
|
let url = contentUrl(for: language)
|
||||||
guard url.exists else {
|
guard url.exists, let size = url.size, size > 0 else {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return url
|
return url
|
||||||
|
@ -35,4 +35,9 @@ extension URL {
|
|||||||
try url.ensureParentFolderExistence()
|
try url.ensureParentFolderExistence()
|
||||||
try FileManager.default.copyItem(at: self, to: url)
|
try FileManager.default.copyItem(at: self, to: url)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var size: Int? {
|
||||||
|
let attributes = try? FileManager.default.attributesOfItem(atPath: path)
|
||||||
|
return (attributes?[.size] as? NSNumber)?.intValue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user