Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Commit b035419

Browse files
committed
fix(keyexchange): Fix bad switch case boolean.
1 parent 7a8ed9f commit b035419

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/stream/KeyExchange.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ function GroupKeyStore({ groupKeys = new Map() }) {
108108
const nextGroupKey = nextGroupKeys.pop()
109109
switch (true) {
110110
// First use of group key on this stream, no current key. Make next key current.
111-
case (!currentGroupKeyId && nextGroupKey): {
111+
case !!(!currentGroupKeyId && nextGroupKey): {
112112
storeKey(nextGroupKey)
113113
currentGroupKeyId = nextGroupKey.id
114114
return [
@@ -117,14 +117,14 @@ function GroupKeyStore({ groupKeys = new Map() }) {
117117
]
118118
}
119119
// Keep using current key (empty next)
120-
case (currentGroupKeyId && !nextGroupKey): {
120+
case !!(currentGroupKeyId && !nextGroupKey): {
121121
return [
122122
this.get(currentGroupKeyId),
123123
undefined
124124
]
125125
}
126126
// Key changed (non-empty next). return current + next. Make next key current.
127-
case (currentGroupKeyId && nextGroupKey): {
127+
case !!(currentGroupKeyId && nextGroupKey): {
128128
storeKey(nextGroupKey)
129129
const prevGroupKey = this.get(currentGroupKeyId)
130130
currentGroupKeyId = nextGroupKey.id

0 commit comments

Comments
 (0)