Ver código fonte

fix(lastN): Update only if neccessary.

factor2
Hristo Terezov 2 anos atrás
pai
commit
4b29af6b5f
1 arquivos alterados com 5 adições e 1 exclusões
  1. 5
    1
      react/features/base/lastn/middleware.ts

+ 5
- 1
react/features/base/lastn/middleware.ts Ver arquivo

@@ -88,7 +88,11 @@ const _updateLastN = debounce(({ dispatch, getState }: IStore) => {
88 88
         lastNSelected = 1;
89 89
     }
90 90
 
91
-    dispatch(setLastN(lastNSelected));
91
+    const { lastN } = state['features/base/lastn'];
92
+
93
+    if (lastN !== lastNSelected) {
94
+        dispatch(setLastN(lastNSelected));
95
+    }
92 96
 }, 1000); /* Don't send this more often than once a second. */
93 97
 
94 98
 

Carregando…
Cancelar
Salvar