Skip to content

Commit

Permalink
Check available disk space before cloning a note
Browse files Browse the repository at this point in the history
  • Loading branch information
nono committed Feb 13, 2024
1 parent 6cd0169 commit 0e88c80
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions model/note/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ import (
// CopyFile is an overloaded version of Fs.CopyFile that take care of also
// copying the images in the note.
func CopyFile(inst *instance.Instance, olddoc, newdoc *vfs.FileDoc) error {
// Check available disk space
_, _, _, err := vfs.CheckAvailableDiskSpace(inst.VFS(), newdoc)
if err != nil {
return err
}

// Load data from the source note
noteDoc, err := get(inst, olddoc)
if err != nil {
Expand Down

0 comments on commit 0e88c80

Please sign in to comment.