Skip to content

Commit afe64da

Browse files
committed
msc4461 delete old records
1 parent b50b10f commit afe64da

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎src/app/hooks/usePerMessageProfile.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,18 @@ export async function getAllPerMessageProfiles(
553553
typeof mx.getAccountData
554554
>[0]
555555
);
556+
557+
// delete old records
558+
await mx.deleteAccountData(
559+
'fyi.cisnt.permessageprofile.index' as Parameters<typeof mx.getAccountData>[0]
560+
);
561+
562+
profiles.forEach(async (profile) => {
563+
if (!profile) return;
564+
await mx.deleteAccountData(
565+
`fyi.cisnt.permessageprofile.${profile.id}` as Parameters<typeof mx.getAccountData>[0]
566+
);
567+
});
556568
}
557569

558570
if (!profileListIndex) return [];

0 commit comments

Comments
 (0)