Skip to content

Commit

Permalink
chore: [ferdium#42] refactor noop proper format
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhamed committed Nov 30, 2022
1 parent a3c6705 commit 6eccab7
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/components/auth/Invite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class Invite extends Component<IProps, IState> {

this.setState({ showSuccessInfo: true });
},
onError: () => {},
onError: noop,
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/auth/Locked.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Locked extends Component<IProps> {
onSuccess: form => {
this.props.onSubmit(form.values());
},
onError: () => {},
onError: noop,
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class Login extends Component<IProps> {
onSuccess: form => {
this.props.onSubmit(form.values());
},
onError: () => {},
onError: noop,
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/auth/Password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Password extends Component<IProps> {
onSuccess: form => {
this.props.onSubmit(form.values());
},
onError: () => {},
onError: noop,
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/auth/Signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class Signup extends Component<IProps> {
onSuccess: form => {
this.props.onSubmit(form.values());
},
onError: () => {},
onError: noop,
});
}

Expand Down
3 changes: 2 additions & 1 deletion src/components/settings/services/EditServiceForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Link } from 'react-router-dom';
import { defineMessages, injectIntl, WrappedComponentProps } from 'react-intl';
import normalizeUrl from 'normalize-url';
import { mdiInformation } from '@mdi/js';
import { noop } from 'lodash';
import Form from '../../../lib/Form';
import Tabs from '../../ui/Tabs/Tabs';
import TabItem from '../../ui/Tabs/TabItem';
Expand Down Expand Up @@ -213,7 +214,7 @@ class EditServiceForm extends Component<IProps, IState> {

this.setState({ isValidatingCustomUrl: false });
},
onError: () => {},
onError: noop,
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/settings/settings/EditSettingsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ class EditSettingsForm extends Component<IProps, IState> {
}
this.props.onSubmit(values);
},
onError: () => {},
onError: noop,
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/settings/user/EditUserForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class EditUserForm extends Component<IProps> {
const values = form.values();
this.props.onSubmit(values);
},
onError: () => {},
onError: noop,
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ interface IProps
showPasswordToggle?: boolean;
data?: IData;
inputClassName?: string;
onEnterKey?: () => {};
onEnterKey?: () => void;
}

interface IState {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ class SelectComponent extends Component<IProps, IState> {
this.setState((state: IState) => ({
open: !state.open,
}))
: () => {}
: noop
}
>
{selection}
Expand Down
7 changes: 4 additions & 3 deletions src/components/ui/textarea/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import classnames from 'classnames';
import { Component, createRef, TextareaHTMLAttributes } from 'react';
import injectSheet, { WithStylesProps } from 'react-jss';

import { noop } from 'lodash';
import { IFormField } from '../typings/generic';

import Error from '../error';
Expand All @@ -24,9 +25,9 @@ interface IProps

class TextareaComponent extends Component<IProps> {
static defaultProps = {
onChange: () => {},
onBlur: () => {},
onFocus: () => {},
onChange: noop,
onBlur: noop,
onFocus: noop,
showLabel: true,
disabled: false,
rows: 5,
Expand Down
3 changes: 2 additions & 1 deletion src/features/workspaces/components/EditWorkspaceForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { observer } from 'mobx-react';
import { defineMessages, injectIntl, WrappedComponentProps } from 'react-intl';
import { Link } from 'react-router-dom';
import withStyles, { WithStylesProps } from 'react-jss';
import { noop } from 'lodash';
import Infobox from '../../../components/ui/infobox/index';
import Input from '../../../components/ui/input';
import Button from '../../../components/ui/button';
Expand Down Expand Up @@ -127,7 +128,7 @@ class EditWorkspaceForm extends Component<IProps> {
const values = f.values();
onSave(values);
},
onError: async () => {},
onError: noop,
});
}

Expand Down
4 changes: 2 additions & 2 deletions src/webview/recipe.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable global-require */
/* eslint-disable import/no-dynamic-require */
/* eslint-disable import/first */
import { noop, debounce } from 'lodash';
import { contextBridge, ipcRenderer } from 'electron';
import { join } from 'path';
import { autorun, computed, makeObservable, observable } from 'mobx';
import { pathExistsSync, readFileSync } from 'fs-extra';
import { debounce } from 'lodash';
import {
disable as disableDarkMode,
enable as enableDarkMode,
Expand Down Expand Up @@ -53,7 +53,7 @@ import Service from '../models/Service';
// As the message API is not actually needed, we'll add this shim sendMessage
// function in order for darkreader to continue working
// @ts-ignore
window.chrome.runtime.sendMessage = () => {};
window.chrome.runtime.sendMessage = noop;

const debug = require('../preload-safe-debug')('Ferdium:Plugin');

Expand Down

0 comments on commit 6eccab7

Please sign in to comment.