From 462f96341e07a33162d4ad97a0f61c75212d084a Mon Sep 17 00:00:00 2001 From: William Grant Date: Mon, 3 Apr 2023 14:09:07 +0200 Subject: [PATCH] fix: iterate allRoominfos map correctly testing complete --- ts/components/dialog/DeleteAccountModal.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ts/components/dialog/DeleteAccountModal.tsx b/ts/components/dialog/DeleteAccountModal.tsx index b276d0e93..22145485b 100644 --- a/ts/components/dialog/DeleteAccountModal.tsx +++ b/ts/components/dialog/DeleteAccountModal.tsx @@ -60,13 +60,12 @@ async function deleteEverythingAndNetworkData() { // a bit of duplicate code below, but it's easier to follow every case like that (helped with returns) // clear all sogs inboxes (includes message requests) - const allRoomInfosMap = await getAllValidOpenGroupV2ConversationRoomInfos(); - if (allRoomInfosMap) { - const allRoomInfos = Object.values(allRoomInfosMap); + const allRoomInfos = await getAllValidOpenGroupV2ConversationRoomInfos(); + if (allRoomInfos && allRoomInfos.size > 0) { // clear each inbox per sogs - for (let i = 0; i < allRoomInfos.length; i++) { + for (const roomInfo of allRoomInfos.values()) { // TODO CONTINUE testing - use a dummy account with some message requests and then if we restore from seed there should be no message requests. - await clearInbox(allRoomInfos[i]); + await clearInbox(roomInfo); } }