Merge pull request #58 from project-error/task/cleanup-all-warnings

Fix all ts warnings
This commit is contained in:
Christopher Gjelten authored and GitHub committed 2021-01-24 18:38:26 +01:00
commit 3bf4cb183e
7 files changed
+12 -28

No files matched your search

@@ -26,7 +26,7 @@ export const BankAlert = () => {
setMessage(t('APPS_BANK_ALERT_TRANSFER_FAILURE'));
setSeverity('error');
}
}, [bankAlert]);
}, [bankAlert, t]);
return (
<Snackbar
@@ -15,10 +15,10 @@ export const BankNotification = () => {
const { config } = usePhone();
useEffect(() => {
if (notification) {
if (notification && notification.id) {
setVisible(true);
}
}, [notification?.id]);
}, [notification]);
if (!config?.bank.showNotifications || !notification) return null;
@@ -6,7 +6,6 @@ import {
Avatar as MuiAvatar,
List,
ListItem,
makeStyles,
} from '@material-ui/core';
import { useFilteredContacts } from '../../hooks/useFilteredContacts';
@@ -22,21 +21,6 @@ import Nui from '../../../../os/nui-events/utils/Nui';
import '../Contact.css';
const useStyles = makeStyles((theme) => ({
updateButton: {
margin: 'auto',
fontSize: 14,
width: 150,
background: '#2196f3',
marginBottom: 10,
padding: 8,
},
collapseItem: {
margin: 'auto',
width: '50%',
},
}));
export const ContactList = () => {
const { filteredContacts } = useFilteredContacts();
const { setShowContactModal } = useContactModal();
@@ -1,5 +1,5 @@
import { Snackbar } from '@material-ui/core';
import React, { useState, useEffect } from 'react';
import React, { useState, useEffect, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { Alert } from '../../../../ui/components/Alert';
import { useContactAlert } from '../../hooks/useAlert';
@@ -21,11 +21,11 @@ export const ContactAlert = () => {
setAlert(null);
};
function setMessageAlert(type: AlertCategory, severity: 'success' | 'error') {
const setMessageAlert = useCallback((type: AlertCategory, severity: 'success' | 'error') => {
setMessage(t(LOCALE_PREFIX + type));
setSeverity(severity);
setOpen(true);
}
}, [t]);
useEffect(() => {
switch (alert) {
@@ -47,7 +47,7 @@ export const ContactAlert = () => {
case 'CONTACT_UPDATE_SUCCESS':
setMessageAlert(alert, 'success');
}
}, [alert]);
}, [alert, setMessageAlert]);
return (
<Snackbar
@@ -34,7 +34,7 @@ const Conversation = ({ activeMessageGroup, messages }: IProps) => {
<img
src={message.message}
className={classes.imageMessage}
alt='image'
alt='multimedia'
/>
) : (
<div>{message.message}</div>
@@ -44,7 +44,7 @@ export const MessageModal = () => {
window.clearInterval(interval);
window.clearTimeout(timeout);
};
}, [activeMessageGroup?.groupId]);
}, [activeMessageGroup]);
useEffect(() => {
// when we get a new message group we should scroll to the
@@ -55,7 +55,7 @@ export const MessageModal = () => {
element.scrollTop = element.scrollHeight;
}
}
}, [minimumLoadPassed, messages?.length]);
}, [activeMessageGroup, minimumLoadPassed]);
// we add a minimum (but short) load time here so that
// there isn't a quick flash of loading and immediately
@@ -54,10 +54,10 @@ function TwitterNotification() {
const { config } = usePhone();
useEffect(() => {
if (notification) {
if (notification && notification.id) {
setVisible(true);
}
}, [notification?.id]);
}, [notification]);
if (!config?.twitter.showNotifications || !notification) return null;