mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	Fix hashchange closing #subscriptions on IE.
This fixes an issue where Array.prototype.split is called on an undefined instance due to the EventTarget.oldURL property not being recorded in IE. We fix this by recording it ourselves.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							5eb5fa3f31
						
					
				
				
					commit
					894f0b5bf0
				
			@@ -210,6 +210,7 @@ function do_hashchange(from_reload) {
 | 
			
		||||
var ignore = {
 | 
			
		||||
    flag: false,
 | 
			
		||||
    prev: null,
 | 
			
		||||
    old_hash: typeof window !== "undefined" ? window.location.hash : "#",
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
function get_main_hash(hash) {
 | 
			
		||||
@@ -231,8 +232,9 @@ function hide_overlays() {
 | 
			
		||||
function hashchanged(from_reload, e) {
 | 
			
		||||
    var old_hash;
 | 
			
		||||
    if (e) {
 | 
			
		||||
        old_hash = "#" + e.oldURL.split(/#/).slice(1).join("");
 | 
			
		||||
        old_hash = "#" + (e.oldURL || ignore.old_hash).split(/#/).slice(1).join("");
 | 
			
		||||
        ignore.last = old_hash;
 | 
			
		||||
        ignore.old_hash = window.location.hash;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    var base = get_main_hash(window.location.hash);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user