Delete the PIN code only when the last session is deleted.

This commit is contained in:
Benoit Marty
2025-10-23 16:46:33 +02:00
committed by Benoit Marty
parent 7777607a37
commit 0284fd22e8
@@ -73,14 +73,15 @@ class DefaultLockScreenService(
}
/**
* Makes sure to delete the pin code when the session is deleted.
* Makes sure to delete the pin code when the last session is deleted.
*/
private fun observeSessionsState() {
sessionObserver.addListener(object : SessionListener {
override suspend fun onSessionDeleted(userId: String, wasLastSession: Boolean) {
// TODO handle multi session at some point
if (wasLastSession) {
pinCodeManager.deletePinCode()
}
}
})
}