mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-01-05 17:40:26 +00:00
Fix deletion of media hyphae with no text
This commit is contained in:
parent
72a3e20ee7
commit
ce6447fea4
@ -18,7 +18,11 @@ func Delete(u *user.User, h hyphae.ExistingHypha) error {
|
||||
originalText, _ := FetchTextFile(h)
|
||||
switch h := h.(type) {
|
||||
case *hyphae.MediaHypha:
|
||||
hop.WithFilesRemoved(h.MediaFilePath(), h.TextFilePath())
|
||||
if h.HasTextFile() {
|
||||
hop.WithFilesRemoved(h.MediaFilePath(), h.TextFilePath())
|
||||
} else {
|
||||
hop.WithFilesRemoved(h.MediaFilePath())
|
||||
}
|
||||
case *hyphae.TextualHypha:
|
||||
hop.WithFilesRemoved(h.TextFilePath())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user