1
0
mirror of https://github.com/koloml/furbooru-tagging-assistant.git synced 2025-12-24 07:12:57 +00:00

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

This commit is contained in:
2024-06-22 14:30:02 +04:00
parent f863b3a475
commit 6433afb03b

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);
}
});