fix: interceptor error from extension issue (#3548)

This commit is contained in:
Nivedin
2023-11-14 17:17:23 +05:30
committed by GitHub
parent e24d0ce605
commit 8d7509cdea
10 changed files with 143 additions and 12 deletions

View File

@@ -152,12 +152,14 @@ export function useStreamSubscriber(): {
error?: (e: any) => void,
complete?: () => void
) => {
const sub = stream.subscribe({
let sub: Subscription | null = null
sub = stream.subscribe({
next,
error,
complete: () => {
if (complete) complete()
subs.splice(subs.indexOf(sub), 1)
if (sub) subs.splice(subs.indexOf(sub), 1)
},
})