Fossil SCM
Lower-case /chat #hashtags filters when they're set rather than on each comparison.
Commit
b8c7665e121b25c3ccc268edbab86ec27c72f7a3c0cd56fa1ed2762a84fadc38
Parent
519f178d64dac8e…
1 file changed
+2
-2
+2
-2
| --- src/fossil.page.chat.js | ||
| +++ src/fossil.page.chat.js | ||
| @@ -194,11 +194,11 @@ | ||
| 194 | 194 | } |
| 195 | 195 | }, |
| 196 | 196 | hashtag:{ |
| 197 | 197 | activeTag: undefined, |
| 198 | 198 | match: function(tag){ |
| 199 | - return !this.activeTag || tag?.toLowerCase?.()===this.activeTag.toLowerCase(); | |
| 199 | + return !this.activeTag || tag?.toLowerCase?.()===this.activeTag; | |
| 200 | 200 | }, |
| 201 | 201 | matchElem: function(e){ |
| 202 | 202 | return !this.activeTag |
| 203 | 203 | || !!e.querySelector('[data-hashtag="'+this.activeTag+'"]'); |
| 204 | 204 | } |
| @@ -838,11 +838,11 @@ | ||
| 838 | 838 | setHashtagFilter: function(tag){ |
| 839 | 839 | if(!tag || (this.filter.current |
| 840 | 840 | && this.filter.current!==this.filter.hashtag)){ |
| 841 | 841 | this.clearFilters(); |
| 842 | 842 | } |
| 843 | - this.filter.hashtag.activeTag = tag; | |
| 843 | + this.filter.hashtag.activeTag = tag.toLowerCase(); | |
| 844 | 844 | if(tag) this.applyMessageFilter(this.filter.hashtag); |
| 845 | 845 | this.filter.current = tag ? this.filter.hashtag : undefined; |
| 846 | 846 | return this; |
| 847 | 847 | }, |
| 848 | 848 | |
| 849 | 849 |
| --- src/fossil.page.chat.js | |
| +++ src/fossil.page.chat.js | |
| @@ -194,11 +194,11 @@ | |
| 194 | } |
| 195 | }, |
| 196 | hashtag:{ |
| 197 | activeTag: undefined, |
| 198 | match: function(tag){ |
| 199 | return !this.activeTag || tag?.toLowerCase?.()===this.activeTag.toLowerCase(); |
| 200 | }, |
| 201 | matchElem: function(e){ |
| 202 | return !this.activeTag |
| 203 | || !!e.querySelector('[data-hashtag="'+this.activeTag+'"]'); |
| 204 | } |
| @@ -838,11 +838,11 @@ | |
| 838 | setHashtagFilter: function(tag){ |
| 839 | if(!tag || (this.filter.current |
| 840 | && this.filter.current!==this.filter.hashtag)){ |
| 841 | this.clearFilters(); |
| 842 | } |
| 843 | this.filter.hashtag.activeTag = tag; |
| 844 | if(tag) this.applyMessageFilter(this.filter.hashtag); |
| 845 | this.filter.current = tag ? this.filter.hashtag : undefined; |
| 846 | return this; |
| 847 | }, |
| 848 | |
| 849 |
| --- src/fossil.page.chat.js | |
| +++ src/fossil.page.chat.js | |
| @@ -194,11 +194,11 @@ | |
| 194 | } |
| 195 | }, |
| 196 | hashtag:{ |
| 197 | activeTag: undefined, |
| 198 | match: function(tag){ |
| 199 | return !this.activeTag || tag?.toLowerCase?.()===this.activeTag; |
| 200 | }, |
| 201 | matchElem: function(e){ |
| 202 | return !this.activeTag |
| 203 | || !!e.querySelector('[data-hashtag="'+this.activeTag+'"]'); |
| 204 | } |
| @@ -838,11 +838,11 @@ | |
| 838 | setHashtagFilter: function(tag){ |
| 839 | if(!tag || (this.filter.current |
| 840 | && this.filter.current!==this.filter.hashtag)){ |
| 841 | this.clearFilters(); |
| 842 | } |
| 843 | this.filter.hashtag.activeTag = tag.toLowerCase(); |
| 844 | if(tag) this.applyMessageFilter(this.filter.hashtag); |
| 845 | this.filter.current = tag ? this.filter.hashtag : undefined; |
| 846 | return this; |
| 847 | }, |
| 848 | |
| 849 |