[gnome-characters: 1/2] Clears current characters before searching by category to prevent duplicates being added to the resu



commit 6f359d0671cfd1f3432020a912d58b20ff16ec88
Author: Paul Court <g rgoyle com>
Date:   Wed Jul 4 23:17:40 2018 +0100

    Clears current characters before searching by category to prevent duplicates being added to the results. 
Fixes #36

 src/characterList.js | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/characterList.js b/src/characterList.js
index f2c582b..cddda1d 100644
--- a/src/characterList.js
+++ b/src/characterList.js
@@ -467,7 +467,9 @@ var CharacterListView = GObject.registerClass({
             hscrollbar_policy: Gtk.PolicyType.NEVER,
             visible: true
         });
+
         scroll.add(this._characterList);
+
         let context = scroll.get_style_context();
         context.add_class('character-list-scroll');
         context.save();
@@ -591,6 +593,7 @@ var CharacterListView = GObject.registerClass({
     }
 
     searchByCategory(category) {
+        this._characters = [];
         if ('scripts' in category) {
             this.searchByScripts(category.scripts);
             return;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]