1
0
mirror of https://github.com/SomboChea/ui synced 2024-11-24 06:54:27 +07:00

fix(App): ts ignore

This commit is contained in:
antoinechalifour 2019-10-03 20:01:43 +02:00
parent 35d691c1e0
commit f6eb74736a

View File

@ -29,7 +29,7 @@ export interface AppStateInterface {
scope: string; scope: string;
showLoginModal: boolean; showLoginModal: boolean;
isUserLoggedIn: boolean; isUserLoggedIn: boolean;
packages: []; packages: any[];
isLoading: boolean; isLoading: boolean;
} }
export default class App extends Component<{}, AppStateInterface> { export default class App extends Component<{}, AppStateInterface> {
@ -85,11 +85,9 @@ export default class App extends Component<{}, AppStateInterface> {
public loadOnHandler = async () => { public loadOnHandler = async () => {
try { try {
// @ts-ignore const packages = await API.request<any[]>('packages', 'GET');
this.req = await API.request('packages', 'GET');
this.setState({ this.setState({
// @ts-ignore packages,
packages: this.req,
isLoading: false, isLoading: false,
}); });
} catch (error) { } catch (error) {
@ -113,7 +111,6 @@ export default class App extends Component<{}, AppStateInterface> {
*/ */
public handleToggleLoginModal = () => { public handleToggleLoginModal = () => {
this.setState(prevState => ({ this.setState(prevState => ({
// @ts-ignore
showLoginModal: !prevState.showLoginModal, showLoginModal: !prevState.showLoginModal,
})); }));
}; };
@ -123,7 +120,6 @@ export default class App extends Component<{}, AppStateInterface> {
* Required by: <Header /> * Required by: <Header />
*/ */
public handleDoLogin = async (usernameValue, passwordValue) => { public handleDoLogin = async (usernameValue, passwordValue) => {
// @ts-ignore
const { username, token, error } = await makeLogin(usernameValue, passwordValue); const { username, token, error } = await makeLogin(usernameValue, passwordValue);
if (username && token) { if (username && token) {
@ -184,7 +180,6 @@ export default class App extends Component<{}, AppStateInterface> {
public renderHeader = (): ReactElement<HTMLElement> => { public renderHeader = (): ReactElement<HTMLElement> => {
const { const {
logoUrl, logoUrl,
// @ts-ignore
user: { username }, user: { username },
scope, scope,
} = this.state; } = this.state;