diff options
| author | Miquel Sabaté Solà <msabate@suse.com> | 2024-03-21 15:49:25 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <msabate@suse.com> | 2024-03-21 15:49:25 +0100 |
| commit | e2f65c0c3cc786865d7e6c4c6118221ee4ca277b (patch) | |
| tree | d95442eb3257bf634ce37a52364340490bde5758 /app | |
| parent | 819f299d3bdc2485394120583b8a76a67b10b418 (diff) | |
| download | operum-e2f65c0c3cc786865d7e6c4c6118221ee4ca277b.tar.gz operum-e2f65c0c3cc786865d7e6c4c6118221ee4ca277b.zip | |
things: use replaceAll when trimming authors
We were using just `#replace`, which gives us some bad results which
were easily fixed via `#replaceAll`.
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to 'app')
| -rw-r--r-- | app/javascript/controllers/thing_controller.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/controllers/thing_controller.js b/app/javascript/controllers/thing_controller.js index ca957ba..615e466 100644 --- a/app/javascript/controllers/thing_controller.js +++ b/app/javascript/controllers/thing_controller.js @@ -46,7 +46,7 @@ export default class extends Controller { if (idx > -1) { let idx2 = author.indexOf('_', idx + 1); if (idx2 > -1) { - return author.substring(idx + 1, idx2).replace(' ', ''); + return author.substring(idx + 1, idx2).replaceAll(' ', ''); } } @@ -54,7 +54,7 @@ export default class extends Controller { // name. return author .split(' ').pop().trim() // Pick the last element. - .replace('-', ''); // "Last-Other" => "LastOther" + .replaceAll('-', ''); // "Last-Other" => "LastOther" } // Update the information we get from the year field so to autocomplete it |
