set default version as 0 and corrected version check
This commit is contained in:
parent
0a8f5ab7d0
commit
b5f05b0afd
2 changed files with 4 additions and 3 deletions
|
@ -180,7 +180,7 @@ class CollectionAttributes {
|
|||
CollectionAttributes({
|
||||
this.encryptedPath,
|
||||
this.pathDecryptionNonce,
|
||||
this.version = 0,
|
||||
this.version,
|
||||
});
|
||||
|
||||
CollectionAttributes copyWith({
|
||||
|
@ -203,6 +203,7 @@ class CollectionAttributes {
|
|||
if (pathDecryptionNonce != null) {
|
||||
map['pathDecryptionNonce'] = pathDecryptionNonce;
|
||||
}
|
||||
if (version != null) map['version'] = version;
|
||||
return map;
|
||||
}
|
||||
|
||||
|
@ -212,7 +213,7 @@ class CollectionAttributes {
|
|||
return CollectionAttributes(
|
||||
encryptedPath: map['encryptedPath'],
|
||||
pathDecryptionNonce: map['pathDecryptionNonce'],
|
||||
version: map['version'],
|
||||
version: map['version'] ?? 0,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -321,7 +321,7 @@ class CollectionsService {
|
|||
}
|
||||
|
||||
String decryptCollectionPath(Collection collection) {
|
||||
final key = collection.attributes.version == 0
|
||||
final key = collection.attributes.version == 1
|
||||
? getCollectionKey(collection.id)
|
||||
: _config.getKey();
|
||||
return utf8.decode(CryptoUtil.decryptSync(
|
||||
|
|
Loading…
Add table
Reference in a new issue