diff --git a/libtextsecure/storage/devices.js b/libtextsecure/storage/devices.js index a3aac4e4b..382332a70 100644 --- a/libtextsecure/storage/devices.js +++ b/libtextsecure/storage/devices.js @@ -92,6 +92,13 @@ if (devicesRemoved != deviceIdsToRemove.length) throw new Error("Tried to remove unknown device"); + + if (newDevices.length === 0) + textsecure.storage.removeEncrypted("devices" + number); + else { + map.devices = newDevices; + textsecure.storage.putEncrypted("devices" + number, map); + } } };