Skip to content

Commit

Permalink
fix: service files encryption on creation (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzkirstein authored Feb 16, 2024
1 parent 9efda06 commit 2c679b1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Nautilus/Asset/Service/NautilusService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export class NautilusService<

let encryptedFiles: string

if (isFilesObjectChanged) {
if (isFilesObjectChanged || !this.existingEncryptedFiles) {
if (this.files.length < 1) {
throw new Error('Can not encrypt files. No files defined!')
}
Expand All @@ -135,6 +135,8 @@ export class NautilusService<
chainId,
this.serviceEndpoint
)
} else {
encryptedFiles = this.existingEncryptedFiles
}

// required attributes
Expand All @@ -144,7 +146,7 @@ export class NautilusService<
type: this.type,
serviceEndpoint: this.serviceEndpoint,
timeout: this.timeout,
files: isFilesObjectChanged ? encryptedFiles : this.existingEncryptedFiles
files: encryptedFiles
}

// add optional attributes if they are defined
Expand Down

0 comments on commit 2c679b1

Please sign in to comment.