mirror of https://github.com/zulip/zulip.git
Report errors due to legacy tuples in hashchange.operators_to_hash.
(imported from commit f639ba52f85bf103afdd26dc4f279e1f03570119)
This commit is contained in:
parent
92b249a0a1
commit
c87b77e52e
|
@ -39,8 +39,14 @@ exports.operators_to_hash = function (operators) {
|
||||||
hash = '#narrow';
|
hash = '#narrow';
|
||||||
_.each(operators, function (elem) {
|
_.each(operators, function (elem) {
|
||||||
// Support legacy tuples.
|
// Support legacy tuples.
|
||||||
var operator = elem.operator || elem[0];
|
var operator = elem.operator;
|
||||||
var operand = elem.operand || elem[1];
|
var operand = elem.operand;
|
||||||
|
|
||||||
|
if (operator === undefined) {
|
||||||
|
blueslip.error("Legacy tuple syntax passed into operators_to_hash.");
|
||||||
|
operator = elem[0];
|
||||||
|
operand = elem[1];
|
||||||
|
}
|
||||||
|
|
||||||
hash += '/' + hashchange.encodeHashComponent(operator)
|
hash += '/' + hashchange.encodeHashComponent(operator)
|
||||||
+ '/' + hashchange.encodeHashComponent(operand);
|
+ '/' + hashchange.encodeHashComponent(operand);
|
||||||
|
|
Loading…
Reference in New Issue