From 134bf8b0d3ef3afa0d1307a1e9d1d0e367cba0f9 Mon Sep 17 00:00:00 2001 From: Ian Morland <16573496+imorland@users.noreply.github.com> Date: Wed, 6 Apr 2022 12:54:25 +0100 Subject: [PATCH] Use searchState (#171) * npm audit fix * Replace search with searchState --- js/package-lock.json | 12 ++++++------ js/src/forum/search/RecipientSearch.js | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/js/package-lock.json b/js/package-lock.json index cbefe29..6bbf73a 100644 --- a/js/package-lock.json +++ b/js/package-lock.json @@ -2828,9 +2828,9 @@ } }, "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" }, "node_modules/ms": { "version": "2.1.2", @@ -5688,9 +5688,9 @@ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" }, "ms": { "version": "2.1.2", diff --git a/js/src/forum/search/RecipientSearch.js b/js/src/forum/search/RecipientSearch.js index c2c3d2e..5cdc93e 100644 --- a/js/src/forum/search/RecipientSearch.js +++ b/js/src/forum/search/RecipientSearch.js @@ -59,11 +59,11 @@ export default class RecipientSearch extends Search { } view() { - if (typeof this.state.getValue() === 'undefined') { - this.state.setValue(''); + if (typeof this.searchState.getValue() === 'undefined') { + this.searchState.setValue(''); } - const loading = this.state.getValue() && this.state.getValue().length >= 3; + const loading = this.searchState.getValue() && this.searchState.getValue().length >= 3; if (!this.sources) { this.sources = this.sourceItems().toArray(); @@ -94,16 +94,16 @@ export default class RecipientSearch extends Search { vnode.dom.focus()} type="search" placeholder={extractText(app.translator.trans('fof-byobu.forum.input.search_recipients'))} - value={this.state.getValue()} - oninput={(e) => this.state.setValue(e.target.value)} + value={this.searchState.getValue()} + oninput={(e) => this.searchState.setValue(e.target.value)} onfocus={() => (this.hasFocus = true)} onblur={() => (this.hasFocus = false)} /> @@ -114,7 +114,7 @@ export default class RecipientSearch extends Search { > {!this.doSearch ? LoadingIndicator.component({ size: 'tiny', className: 'Button Button--icon Button--link' }) - : this.sources.map((source) => source.view(this.state.getValue()))} + : this.sources.map((source) => source.view(this.searchState.getValue()))} @@ -163,7 +163,7 @@ export default class RecipientSearch extends Search { this.attrs.selected().add(value, recipient); - this.state.clear(); + this.searchState.clear(); } /**