diff --git a/src/app/hooks/usePerMessageProfile.ts b/src/app/hooks/usePerMessageProfile.ts index 07a4ce53b..5fdf4d7f4 100644 --- a/src/app/hooks/usePerMessageProfile.ts +++ b/src/app/hooks/usePerMessageProfile.ts @@ -553,6 +553,18 @@ export async function getAllPerMessageProfiles( typeof mx.getAccountData >[0] ); + + // delete old records + await mx.deleteAccountData( + 'fyi.cisnt.permessageprofile.index' as Parameters[0] + ); + + profiles.forEach(async (profile) => { + if (!profile) return; + await mx.deleteAccountData( + `fyi.cisnt.permessageprofile.${profile.id}` as Parameters[0] + ); + }); } if (!profileListIndex) return [];