async function updateUnencrypted(contact) {
        const contactURL = requestURL(contact.ID);
        const encryptPromise = contactEncryption.encrypt([contact]);
        const previousPromise = request(contactURL);

        const [[next], { Contact: previous }] = await Promise.all([encryptPromise, previousPromise]);

        const isEncrypted = (Type) => ENCRYPTED_MODES.includes(Type);
        const previousEncrypted = previous.Cards.filter(({ Type }) => isEncrypted(Type));

        next.Cards = next.Cards.filter(({ Type }) => !isEncrypted(Type)).concat(previousEncrypted);

        const { data = {} } = (await $http.put(contactURL, next)) || {};
        // NOTE We need to pass the cards to update the encrypted icon in the contact view
        data.cards = next.Cards;
        return data;
    }
/**
     * Update a contact without touching the encrypted part: allows you to keep the encrypted part intact if the encryption
     * becomes broken (e.g. password reset)
     * @param {Object} contact
     * @return {Promise}
     */
Update a contact without touching the encrypted part: allows you to keep the encrypted part intact if the encryption
becomes broken
@param {Object} contact
@return {Promise}
Update a contact without touching the encrypted part : allows you to keep the encrypted part intact if the encryption becomes broken @param { Object } contact @return { Promise }
async function updateUnencrypted(contact) {
        const contactURL = requestURL(contact.ID);
        const encryptPromise = contactEncryption.encrypt([contact]);
        const previousPromise = request(contactURL);
        const [[next], { Contact: previous }] = await Promise.all([encryptPromise, previousPromise]);
        const isEncrypted = (Type) => ENCRYPTED_MODES.includes(Type);
        const previousEncrypted = previous.Cards.filter(({ Type }) => isEncrypted(Type));
        next.Cards = next.Cards.filter(({ Type }) => !isEncrypted(Type)).concat(previousEncrypted);
        const { data = {} } = (await $http.put(contactURL, next)) || {};
        data.cards = next.Cards;
        return data;
    }
async function updateUnencrypted ( contact ) { const contactURL = requestURL ( contact . ID ) ; const encryptPromise = contactEncryption . encrypt ( [ contact ] ) ; const previousPromise = request ( contactURL ) ; const [ [ next ] , { Contact : previous } ] = await Promise . all ( [ encryptPromise , previousPromise ] ) ; const isEncrypted = ( Type ) => ENCRYPTED_MODES . includes ( Type ) ; const previousEncrypted = previous . Cards . filter ( ( { Type } ) => isEncrypted ( Type ) ) ; next . Cards = next . Cards . filter ( ( { Type } ) => ! isEncrypted ( Type ) ) . concat ( previousEncrypted ) ; const { data = { } } = ( await $http . put ( contactURL , next ) ) || { } ; data . cards = next . Cards ; return data ; }
Update a contact without touching the encrypted part: allows you to keep the encrypted part intact if the encryption
 becomes broken (e.g.
Update a contact without touching the encrypted part : allows you to keep the encrypted part intact if the encryption becomes broken ( e . g .
// NOTE We need to pass the cards to update the encrypted icon in the contact view