mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	Switching from $.parseJSON to JSON.parse.
There are no modern browsers that do not have built in JSON parsing abilities. We do not need $.parseJSON as it now just serves as a call to JSON.parse.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							636d2df868
						
					
				
				
					commit
					e52d618f1b
				
			@@ -34,7 +34,7 @@ function call(args, idempotent) {
 | 
			
		||||
 | 
			
		||||
        if (xhr.status === 403) {
 | 
			
		||||
            try {
 | 
			
		||||
                if ($.parseJSON(xhr.responseText).msg.indexOf("CSRF Error:") !== -1) {
 | 
			
		||||
                if (JSON.parse(xhr.responseText).msg.indexOf("CSRF Error:") !== -1) {
 | 
			
		||||
                    reload.initiate({immediate: true,
 | 
			
		||||
                                     save_pointer: true,
 | 
			
		||||
                                     save_narrow: true,
 | 
			
		||||
@@ -117,7 +117,7 @@ exports.xhr_error_message = function (message, xhr) {
 | 
			
		||||
    if (xhr.status.toString().charAt(0) === "4") {
 | 
			
		||||
        // Only display the error response for 4XX, where we've crafted
 | 
			
		||||
        // a nice response.
 | 
			
		||||
        message += ": " + $.parseJSON(xhr.responseText).msg;
 | 
			
		||||
        message += ": " + JSON.parse(xhr.responseText).msg;
 | 
			
		||||
    }
 | 
			
		||||
    return message;
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user