mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 05:53:43 +00:00
hashchange: Add warning if pushState is not available.
This commit is contained in:
@@ -303,7 +303,10 @@ run_test('save_narrow', () => {
|
|||||||
{operator: 'is', operand: 'private'},
|
{operator: 'is', operand: 'private'},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
blueslip.set_test_data('warn', 'browser does not support pushState');
|
||||||
hashchange.save_narrow(operators);
|
hashchange.save_narrow(operators);
|
||||||
|
blueslip.clear_test_data();
|
||||||
|
|
||||||
helper.assert_events([
|
helper.assert_events([
|
||||||
'message_viewport.stop_auto_scrolling',
|
'message_viewport.stop_auto_scrolling',
|
||||||
'favicon.reset',
|
'favicon.reset',
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ function set_hash(hash) {
|
|||||||
var url = get_full_url(hash);
|
var url = get_full_url(hash);
|
||||||
history.pushState(null, null, url);
|
history.pushState(null, null, url);
|
||||||
} else {
|
} else {
|
||||||
|
blueslip.warn('browser does not support pushState');
|
||||||
window.location.hash = hash;
|
window.location.hash = hash;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user