chore: handle notification of another member being removed (#2525)

This commit is contained in:
Aman Harwara
2023-09-22 13:10:53 +05:30
committed by GitHub
parent 07d18a6e9a
commit 80711a17fa
3 changed files with 11 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ import { HandleKeyPairChange } from '../Contacts/UseCase/HandleKeyPairChange'
import { FindContact } from '../Contacts/UseCase/FindContact'
import { GetOwnedSharedVaults } from './UseCase/GetOwnedSharedVaults'
import { SyncLocalVaultsWithRemoteSharedVaults } from './UseCase/SyncLocalVaultsWithRemoteSharedVaults'
import { VaultUserServiceInterface } from '../VaultUser/VaultUserServiceInterface'
export class SharedVaultService
extends AbstractService<SharedVaultServiceEvent, SharedVaultServiceEventPayload>
@@ -41,6 +42,7 @@ export class SharedVaultService
constructor(
private items: ItemManagerInterface,
private session: SessionsClientInterface,
private vaultUsers: VaultUserServiceInterface,
private _syncLocalVaultsWithRemoteSharedVaults: SyncLocalVaultsWithRemoteSharedVaults,
private _getVault: GetVault,
private _getOwnedSharedVaults: GetOwnedSharedVaults,
@@ -110,6 +112,10 @@ export class SharedVaultService
}
break
}
case NotificationType.TYPES.UserRemovedFromSharedVault: {
this.vaultUsers.invalidateVaultUsersCache(event.eventPayload.props.sharedVaultUuid.value).catch(console.error)
break
}
case NotificationType.TYPES.SharedVaultItemRemoved: {
const item = this.items.findItem((event.eventPayload.props.itemUuid as Uuid).value)
if (item) {