fix some eslint errors
This commit is contained in:
parent
dbf46556c8
commit
ad200cfcad
|
@ -59,6 +59,8 @@ const Captcha = ({ autoload, width, setLegit }) => {
|
|||
if (autoload) {
|
||||
reloadCaptcha();
|
||||
}
|
||||
// intentionally only executed on first render
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
const contWidth = width || 100;
|
||||
|
|
|
@ -145,6 +145,7 @@ function Converter() {
|
|||
extraOpts,
|
||||
scaleData,
|
||||
gridData,
|
||||
canvases,
|
||||
]);
|
||||
|
||||
const {
|
||||
|
@ -171,17 +172,17 @@ function Converter() {
|
|||
if (showExtraOptions) {
|
||||
setTimeout(() => setExtraRender(true), 10);
|
||||
}
|
||||
}, [selectedStrategy]);
|
||||
}, [showExtraOptions]);
|
||||
useEffect(() => {
|
||||
if (gridEnabled) {
|
||||
setTimeout(() => setGridRender(true), 10);
|
||||
}
|
||||
}, [gridData.enabled]);
|
||||
}, [gridEnabled]);
|
||||
useEffect(() => {
|
||||
if (scalingEnabled) {
|
||||
setTimeout(() => setScalingRender(true), 10);
|
||||
}
|
||||
}, [scaleData.enabled]);
|
||||
}, [scalingEnabled]);
|
||||
|
||||
const gimpLink = <a href="https://www.gimp.org">GIMP</a>;
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ const HistorySelect = () => {
|
|||
setTime(date, newTimes[0]);
|
||||
}
|
||||
setSubmitting(false);
|
||||
}, [submitting, times]);
|
||||
}, [submitting, canvasId, setTime]);
|
||||
|
||||
const changeTime = useCallback(async (diff) => {
|
||||
if (!times.length
|
||||
|
@ -97,7 +97,7 @@ const HistorySelect = () => {
|
|||
|
||||
setTimes(newTimes);
|
||||
setTime(newSelectedDate, newTimes[newPos]);
|
||||
}, [historicalTime, times, submitting]);
|
||||
}, [historicalTime, times, canvasId, setTime]);
|
||||
|
||||
const selectedDate = stringToDate(historicalDate);
|
||||
const selectedTime = stringToTime(historicalTime);
|
||||
|
|
|
@ -11,12 +11,11 @@ import { t } from 'ttag';
|
|||
import { MONTH } from '../core/constants';
|
||||
|
||||
function LanguageSelect() {
|
||||
const { lang, langs } = window.ssv;
|
||||
|
||||
const [langSel, setLangSel] = useState(lang);
|
||||
const [langSel, setLangSel] = useState(window.ssv.lang);
|
||||
const [ccSel, setCCSel] = useState('xx');
|
||||
|
||||
useEffect(() => {
|
||||
const { langs } = window.ssv;
|
||||
for (let i = 0; i < langs.length; i += 1) {
|
||||
const [lc, cc] = langs[i];
|
||||
if (lc === langSel) {
|
||||
|
@ -41,7 +40,7 @@ function LanguageSelect() {
|
|||
}}
|
||||
>
|
||||
{
|
||||
langs.map(([l]) => (
|
||||
window.ssv.langs.map(([l]) => (
|
||||
<option
|
||||
key={l}
|
||||
value={l}
|
||||
|
|
|
@ -17,7 +17,7 @@ const NotifyBox = () => {
|
|||
setClassName(newClassName);
|
||||
}
|
||||
}
|
||||
}, [notification]);
|
||||
}, [notification, className]);
|
||||
|
||||
return (
|
||||
<div
|
||||
|
|
|
@ -83,7 +83,7 @@ const Rankings = () => {
|
|||
return null;
|
||||
}
|
||||
return getOnlineStatsData(onlineStats, pHourlyStats);
|
||||
}, [area, onlineStats]);
|
||||
}, [area, onlineStats, pHourlyStats]);
|
||||
|
||||
const onlineOpts = useMemo(() => {
|
||||
if (area !== 'charts') {
|
||||
|
|
|
@ -28,7 +28,7 @@ const UIPopUp = () => {
|
|||
setTitle: (title) => dispatch(setWindowTitle(title)),
|
||||
// eslint-disable-next-line max-len
|
||||
changeType: (newType, newTitle, newArgs) => dispatch(changeWindowType(newType, newTitle, newArgs)),
|
||||
}), [args]);
|
||||
}), [args, dispatch]);
|
||||
|
||||
return (
|
||||
<div
|
||||
|
|
|
@ -69,7 +69,7 @@ const ChatButton = () => {
|
|||
if (i === cids.length) {
|
||||
setUnreadAny(false);
|
||||
}
|
||||
});
|
||||
}, [chatNotify, chatOpen, channels, unread, mute]);
|
||||
|
||||
return (
|
||||
<div
|
||||
|
|
|
@ -59,7 +59,7 @@ const MovementControls = () => {
|
|||
break;
|
||||
default:
|
||||
}
|
||||
}, []);
|
||||
}, [dispatch]);
|
||||
|
||||
const onPressStop = useCallback((event) => {
|
||||
event.preventDefault();
|
||||
|
@ -84,12 +84,12 @@ const MovementControls = () => {
|
|||
break;
|
||||
default:
|
||||
}
|
||||
}, []);
|
||||
}, [dispatch]);
|
||||
|
||||
const onCancel = useCallback((event) => {
|
||||
event.preventDefault();
|
||||
dispatch(cancelMove());
|
||||
}, []);
|
||||
}, [dispatch]);
|
||||
|
||||
const refCallBack = useCallback((node) => {
|
||||
if (!node) {
|
||||
|
|
|
@ -51,7 +51,7 @@ const ChannelDropDown = ({
|
|||
setType(chType);
|
||||
}
|
||||
}
|
||||
}, [show]);
|
||||
}, [show, channels, chatChannel]);
|
||||
|
||||
useEffect(() => {
|
||||
const cids = Object.keys(channels);
|
||||
|
@ -90,7 +90,7 @@ const ChannelDropDown = ({
|
|||
if (i === cids.length) {
|
||||
setUnreadAny(false);
|
||||
}
|
||||
}, [channels, unread]);
|
||||
}, [channels, unread, mute, unreadAny]);
|
||||
|
||||
useEffect(() => {
|
||||
const cids = Object.keys(channels);
|
||||
|
|
|
@ -27,7 +27,7 @@ const TikTok = ({ url }) => {
|
|||
}
|
||||
}
|
||||
fetchData();
|
||||
}, []);
|
||||
}, [url]);
|
||||
|
||||
if (!embedCode) {
|
||||
return <div>LOADING</div>;
|
||||
|
|
|
@ -19,7 +19,7 @@ export function useConditionalClickOutside(insideRefs, active, callback) {
|
|||
|| !ref.current.contains(event.target))) {
|
||||
callback();
|
||||
}
|
||||
}, [callback]);
|
||||
}, [callback, insideRefs]);
|
||||
|
||||
const handleWindowResize = useCallback(() => {
|
||||
callback();
|
||||
|
@ -37,7 +37,7 @@ export function useConditionalClickOutside(insideRefs, active, callback) {
|
|||
});
|
||||
window.removeEventListener('resize', handleWindowResize);
|
||||
}
|
||||
}, [active, callback]);
|
||||
}, [active, handleClickOutside, handleWindowResize]);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -126,7 +126,7 @@ function useLink() {
|
|||
|
||||
// open within window
|
||||
contextData.changeType(windowType, title, args);
|
||||
}, [contextData]);
|
||||
}, [contextData, dispatch]);
|
||||
}
|
||||
|
||||
export default useLink;
|
||||
|
|
|
@ -19,7 +19,7 @@ function usePostMessage(iFrameRef, callback) {
|
|||
window.addEventListener('message', handleMessage, false);
|
||||
|
||||
return () => window.removeEventListener('message', handleMessage);
|
||||
}, []);
|
||||
}, [iFrameRef]);
|
||||
}
|
||||
|
||||
export default usePostMessage;
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* @flex
|
||||
*
|
||||
* can be used in react components
|
||||
* to trigger on window resize
|
||||
*/
|
||||
|
|
|
@ -53,7 +53,7 @@ const SettingsItemSelect = ({
|
|||
</div>
|
||||
);
|
||||
|
||||
function Settings() {
|
||||
const Settings = () => {
|
||||
const [
|
||||
isGridShown,
|
||||
isPixelNotifyShown,
|
||||
|
@ -194,6 +194,6 @@ function Settings() {
|
|||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export default React.memo(Settings);
|
||||
|
|
|
@ -42,7 +42,7 @@ const UserArea = () => {
|
|||
activeTab: label,
|
||||
});
|
||||
setTitle(label);
|
||||
}, [setArgs]);
|
||||
}, [setArgs, setTitle]);
|
||||
|
||||
useInterval(() => {
|
||||
if (Date.now() - 300000 > lastStatsFetch) {
|
||||
|
|
|
@ -122,7 +122,6 @@ class VoxelPainterControls {
|
|||
storeViewInStateTime = Date.now();
|
||||
prevTime = Date.now();
|
||||
offset = new Vector3();
|
||||
direction = new Vector3();
|
||||
velocity = new Vector3();
|
||||
vec = new Vector3();
|
||||
// forcing next update
|
||||
|
@ -622,7 +621,6 @@ class VoxelPainterControls {
|
|||
camera,
|
||||
target,
|
||||
velocity,
|
||||
direction,
|
||||
offset,
|
||||
vec,
|
||||
spherical,
|
||||
|
|
|
@ -17,12 +17,8 @@ import {
|
|||
setMoveV,
|
||||
setMoveW,
|
||||
} from '../store/actions';
|
||||
import {
|
||||
HOLD_PAINT,
|
||||
} from '../core/constants';
|
||||
import {
|
||||
notify,
|
||||
} from '../store/actions/thunks';
|
||||
import { HOLD_PAINT } from '../core/constants';
|
||||
import { notify } from '../store/actions/thunks';
|
||||
|
||||
const charKeys = ['g', 'h', 'x', 'm', 'r', 'p', '+', '-'];
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user