chore: ui for designating survivor for shared vault & warning when no survivor (#2544)

This commit is contained in:
Aman Harwara
2023-09-29 16:38:38 +05:30
committed by GitHub
parent 7c8816e229
commit 79c5da6c5b
8 changed files with 162 additions and 15 deletions

View File

@@ -49,6 +49,7 @@ describe('SharedVaultService', () => {
eventBus.addEventHandler = jest.fn()
service = new SharedVaultService(
sync,
items,
session,
vaultUsers,

View File

@@ -34,12 +34,14 @@ import { FindContact } from '../Contacts/UseCase/FindContact'
import { GetOwnedSharedVaults } from './UseCase/GetOwnedSharedVaults'
import { SyncLocalVaultsWithRemoteSharedVaults } from './UseCase/SyncLocalVaultsWithRemoteSharedVaults'
import { VaultUserServiceInterface } from '../VaultUser/VaultUserServiceInterface'
import { SyncServiceInterface } from '../Sync/SyncServiceInterface'
export class SharedVaultService
extends AbstractService<SharedVaultServiceEvent, SharedVaultServiceEventPayload>
implements SharedVaultServiceInterface, InternalEventHandlerInterface
{
constructor(
private sync: SyncServiceInterface,
private items: ItemManagerInterface,
private session: SessionsClientInterface,
private vaultUsers: VaultUserServiceInterface,
@@ -123,9 +125,13 @@ export class SharedVaultService
.invalidateVaultUsersCache(event.eventPayload.props.primaryIdentifier.value)
.catch(console.error)
await this._syncLocalVaultsWithRemoteSharedVaults.execute([vault])
void this.notifyEvent(SharedVaultServiceEvent.SharedVaultStatusChanged)
this.sync
.sync()
.then(async () => {
await this._syncLocalVaultsWithRemoteSharedVaults.execute([vault])
void this.notifyEvent(SharedVaultServiceEvent.SharedVaultStatusChanged)
})
.catch(console.error)
}
break
}