Skip to content

Commit 17519c3

Browse files
committed
invert a negative 'if' statement
1 parent 10aba36 commit 17519c3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/firestore/src/lite-api/settings.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,14 @@ export class FirestoreSettingsImpl {
136136

137137
if (this.experimentalForceLongPolling) {
138138
this.experimentalAutoDetectLongPolling = false;
139-
} else if (settings.experimentalAutoDetectLongPolling !== undefined) {
139+
} else if (settings.experimentalAutoDetectLongPolling === undefined) {
140+
this.experimentalAutoDetectLongPolling = DEFAULT_AUTO_DETECT_LONG_POLLING;
141+
} else {
140142
// For backwards compatibility, coerce the value to boolean even though
141143
// the TypeScript compiler has narrowed the type to boolean already.
142144
// noinspection PointlessBooleanExpressionJS
143145
this.experimentalAutoDetectLongPolling =
144146
!!settings.experimentalAutoDetectLongPolling;
145-
} else {
146-
this.experimentalAutoDetectLongPolling = DEFAULT_AUTO_DETECT_LONG_POLLING;
147147
}
148148

149149
this.useFetchStreams = !!settings.useFetchStreams;

0 commit comments

Comments
 (0)