Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incorrect typings for Modal hide() method #3180

Merged
merged 2 commits into from
Nov 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions js/src/common/components/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default abstract class Modal<ModalAttrs extends IInternalModalAttrs = IIn
<div className="Modal-close App-backControl">
{Button.component({
icon: 'fas fa-times',
onclick: this.hide.bind(this),
onclick: () => this.hide(),
className: 'Button Button--icon Button--link',
'aria-label': app.translator.trans('core.lib.modal.close'),
})}
Expand Down Expand Up @@ -148,14 +148,14 @@ export default abstract class Modal<ModalAttrs extends IInternalModalAttrs = IIn
/**
* Hides the modal.
*/
hide() {
hide(): void {
this.attrs.state.close();
}

/**
* Sets `loading` to false and triggers a redraw.
*/
loaded() {
loaded(): void {
this.loading = false;
m.redraw();
}
Expand All @@ -164,7 +164,7 @@ export default abstract class Modal<ModalAttrs extends IInternalModalAttrs = IIn
* Shows an alert describing an error returned from the API, and gives focus to
* the first relevant field involved in the error.
*/
onerror(error: RequestError) {
onerror(error: RequestError): void {
this.alertAttrs = error.alert;

m.redraw();
Expand Down