diff options
| author | neobooru | 2019-10-25 14:12:41 +0200 |
|---|---|---|
| committer | Shyam Sunder | 2019-10-25 11:10:56 -0400 |
| commit | eb49aea683a64f905965b58f6f81c348a4aa0e99 (patch) | |
| tree | 2bc10bbad2d936deb85dce03b28c34d0ee221c2d /client | |
| parent | 4f5ea9c5eda5062792eb1ba04a01d28e338870ce (diff) | |
client/posts: remember offset when opening/closing bulk editor
Fixes rr-#274
Squashed with commit "client/posts: make prevQuery a const"
Diffstat (limited to 'client')
| -rw-r--r-- | client/js/views/posts_header_view.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/client/js/views/posts_header_view.js b/client/js/views/posts_header_view.js index 6b697c4..9ba09c9 100644 --- a/client/js/views/posts_header_view.js +++ b/client/js/views/posts_header_view.js @@ -246,8 +246,10 @@ class PostsHeaderView extends events.EventTarget { _navigate() { this._autoCompleteControl.hide(); let parameters = {query: this._queryInputNode.value}; - parameters.offset = parameters.query === this._ctx.parameters.query ? - this._ctx.parameters.offset : 0; + + // convert falsy values to an empty string "" so that we can correctly compare with the current query + const prevQuery = this._ctx.parameters.query ? this._ctx.parameters.query : ""; + parameters.offset = parameters.query === prevQuery ? this._ctx.parameters.offset : 0; if (this._bulkTagEditor && this._bulkTagEditor.opened) { parameters.tag = this._bulkTagEditor.value; this._bulkTagEditor.blur(); |