fix(GODT-2343): Only poll after send if sync is complete

This commit is contained in:
James Houlahan
2023-02-06 15:47:11 +01:00
parent 2cb2ca15c7
commit e89dcb2cca
2 changed files with 21 additions and 3 deletions

View File

@ -431,7 +431,9 @@ func (user *User) NewIMAPConnectors() (map[string]connector.Connector, error) {
// SendMail sends an email from the given address to the given recipients.
func (user *User) SendMail(authID string, from string, to []string, r io.Reader) error {
defer user.goPollAPIEvents(true)
if user.vault.SyncStatus().IsComplete() {
defer user.goPollAPIEvents(true)
}
if len(to) == 0 {
return ErrInvalidRecipient