Skip to content

Commit

Permalink
chore: display shared vault file usage
Browse files Browse the repository at this point in the history
  • Loading branch information
karolsojko committed Aug 9, 2023
1 parent 90dcb33 commit ed6d265
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export type AsymmetricMessageSharedVaultInvite = {
name: string
description?: string
iconString: IconType | EmojiString
fileBytesUsed: number
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export type VaultListingSharingInfo = {
sharedVaultUuid: string
ownerUserUuid: string
fileBytesUsed: number
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export interface SharedVaultServerHash {
uuid: string
user_uuid: string
file_upload_bytes_used: number
file_upload_bytes_limit: number
created_at_timestamp: number
updated_at_timestamp: number
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class ProcessAcceptedVaultInvite {
sharing: {
sharedVaultUuid: sharedVaultUuid,
ownerUserUuid: ownerUuid,
fileBytesUsed: metadata.fileBytesUsed,
},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export class ConvertToSharedVault {
mutator.sharing = {
sharedVaultUuid: serverVaultHash.uuid,
ownerUserUuid: serverVaultHash.user_uuid,
fileBytesUsed: serverVaultHash.file_upload_bytes_used,
}
},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export class CreateSharedVault {
mutator.sharing = {
sharedVaultUuid: serverVaultHash.uuid,
ownerUserUuid: serverVaultHash.user_uuid,
fileBytesUsed: serverVaultHash.file_upload_bytes_used,
}
},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export class InviteToVault implements UseCaseInterface<SharedVaultInviteServerHa
name: params.sharedVault.name,
description: params.sharedVault.description,
iconString: params.sharedVault.iconString,
fileBytesUsed: params.sharedVault.sharing.fileBytesUsed,
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const VaultItem = ({ vault }: Props) => {

const isAdmin = !vault.isSharedVaultListing() ? true : application.vaultUsers.isCurrentUserSharedVaultAdmin(vault)

console.log(vault.sharing)

const deleteVault = useCallback(async () => {
const confirm = await application.alerts.confirm(
'Deleting a vault will permanently delete all its items and files.',
Expand Down

0 comments on commit ed6d265

Please sign in to comment.