Fixed active profile ID still pointing on profile when it's deleted

This commit is contained in:
koloml committed 2024-06-22 14:30:02 +04:00
1 parent f863b3a475
commit 6433afb03b
1 file changed
+8 -1
+8 -1
View File
@@ -44,4 +44,11 @@ activeProfileStore.subscribe(profileId => {
lastActiveProfileId = profileId;
void maintenanceSettings.setActiveProfileId(profileId);
})
});
// Watch the existence of the active profile on every change.
MaintenanceProfile.subscribe(profiles => {
if (!profiles.find(profile => profile.id === lastActiveProfileId)) {
activeProfileStore.set(null);
}
});