mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 05:53:43 +00:00
hashchange: Go to home page for bogus narrows.
This was the original intent of the code, and I think it's the right behavior.
This commit is contained in:
@@ -133,23 +133,25 @@ exports.parse_narrow = function (hash) {
|
||||
for (i = 1; i < hash.length; i += 2) {
|
||||
// We don't construct URLs with an odd number of components,
|
||||
// but the user might write one.
|
||||
try {
|
||||
var operator = exports.decodeHashComponent(hash[i]);
|
||||
// Do not parse further if empty operator encountered.
|
||||
if (operator === '') {
|
||||
break;
|
||||
}
|
||||
var operator = exports.decodeHashComponent(hash[i]);
|
||||
// Do not parse further if empty operator encountered.
|
||||
if (operator === '') {
|
||||
break;
|
||||
}
|
||||
|
||||
var operand = exports.decode_operand(operator, hash[i + 1] || '');
|
||||
var negated = false;
|
||||
if (operator[0] === '-') {
|
||||
negated = true;
|
||||
operator = operator.slice(1);
|
||||
}
|
||||
operators.push({negated: negated, operator: operator, operand: operand});
|
||||
} catch (err) {
|
||||
var raw_operand = hash[i + 1];
|
||||
|
||||
if (!raw_operand) {
|
||||
return;
|
||||
}
|
||||
|
||||
var operand = exports.decode_operand(operator, raw_operand);
|
||||
var negated = false;
|
||||
if (operator[0] === '-') {
|
||||
negated = true;
|
||||
operator = operator.slice(1);
|
||||
}
|
||||
operators.push({negated: negated, operator: operator, operand: operand});
|
||||
}
|
||||
return operators;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user