Skip to content

Commit

Permalink
Merge pull request #944 from cozy/fix/550-2
Browse files Browse the repository at this point in the history
Fix/550 2
  • Loading branch information
Merkur39 committed Jul 18, 2023
2 parents 6311c6b + 2f1577a commit c8a5299
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
7 changes: 6 additions & 1 deletion src/components/ContactsList/ContactsEmptyList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ const ContactsEmptyList = () => {

return (
<div className="u-flex u-flex-column u-flex-items-center">
<Empty className="contacts-empty" icon={EmptyIcon} title={emptyTitle}>
<Empty
className="contacts-empty"
icon={EmptyIcon}
title={emptyTitle}
iconSize="large"
>
<Stack spacing="xs" className="u-mt-1">
<div>
<Button
Expand Down
12 changes: 11 additions & 1 deletion src/connections/allContacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import get from 'lodash/get'
import isEqual from 'lodash/isEqual'
import uniqWith from 'lodash/uniqWith'

import log from 'cozy-logger'

import { addGroupToContact } from '../helpers/contacts'
import { DOCTYPE_CONTACTS } from '../helpers/doctypes'
import { hasSelectedGroup } from '../helpers/groups'
Expand Down Expand Up @@ -186,5 +188,13 @@ export const trashedAllContactsByGroupId = async (client, groupId) => {
return contact
})

await client.saveAll(contactsTrashed)
try {
await client.saveAll(contactsTrashed)
} catch (error) {
if (contactsTrashed.length === 0) {
log('info', 'No contacts to trash')
} else {
log('error', `Error saving contact to trash: ${error}`)
}
}
}
3 changes: 0 additions & 3 deletions src/styles/contacts.styl
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ main

// TODO: Find a better way to set the .empty icon size
.contacts-empty
+small-screen()
margin-top: calc(50vh - 6rem)
transform: translateY(-50%)
&>svg
height 300px
width 280px

0 comments on commit c8a5299

Please sign in to comment.