mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-16 03:43:08 +00:00
[Glitch] Enforce React Rules of Hooks with eslint
Port d9b93bd15e
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
108720d7b0
commit
b509b96504
|
@ -52,8 +52,10 @@ export const connectTimelineStream = (timelineId, channelName, params = {}, opti
|
||||||
/**
|
/**
|
||||||
* @param {function(Function, Function): void} fallback
|
* @param {function(Function, Function): void} fallback
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const useFallback = fallback => {
|
const useFallback = fallback => {
|
||||||
fallback(dispatch, () => {
|
fallback(dispatch, () => {
|
||||||
|
// eslint-disable-next-line react-hooks/rules-of-hooks -- this is not a react hook
|
||||||
pollingId = setTimeout(() => useFallback(fallback), 20000 + randomUpTo(20000));
|
pollingId = setTimeout(() => useFallback(fallback), 20000 + randomUpTo(20000));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -72,6 +72,7 @@ const mapDispatchToProps = (dispatch, { onPickEmoji }) => ({
|
||||||
},
|
},
|
||||||
|
|
||||||
onPickEmoji: emoji => {
|
onPickEmoji: emoji => {
|
||||||
|
// eslint-disable-next-line react-hooks/rules-of-hooks -- this is not a react hook
|
||||||
dispatch(useEmoji(emoji));
|
dispatch(useEmoji(emoji));
|
||||||
|
|
||||||
if (onPickEmoji) {
|
if (onPickEmoji) {
|
||||||
|
|
|
@ -26,6 +26,7 @@ const mapDispatchToProps = dispatch => ({
|
||||||
},
|
},
|
||||||
|
|
||||||
onClose (value) {
|
onClose (value) {
|
||||||
|
// eslint-disable-next-line react-hooks/rules-of-hooks -- this is not a react hook
|
||||||
dispatch(useLanguage(value));
|
dispatch(useLanguage(value));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue