mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 14:03:30 +00:00 
			
		
		
		
	search/hash_util: Parse negated searches properly.
Fixes #14254 You can test this on dev: * do "-stream:Verona" in the search bar (the minus sign negates the search here) * reload the browser You should see the same search (all streams besides Verona).
This commit is contained in:
		@@ -166,12 +166,13 @@ exports.parse_narrow = function (hash) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        const operand  = exports.decode_operand(operator, raw_operand);
 | 
			
		||||
        let negated = false;
 | 
			
		||||
        if (operator[0] === '-') {
 | 
			
		||||
            negated = true;
 | 
			
		||||
            operator = operator.slice(1);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        const operand  = exports.decode_operand(operator, raw_operand);
 | 
			
		||||
        operators.push({negated: negated, operator: operator, operand: operand});
 | 
			
		||||
    }
 | 
			
		||||
    return operators;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user