mirror of
				https://github.com/zulip/zulip-desktop.git
				synced 2025-11-04 05:53:21 +00:00 
			
		
		
		
	This PR adds a params-util.js file which checks wheather the page_params exists or not. Fixes: #517.
		
			
				
	
	
		
			16 lines
		
	
	
		
			330 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			330 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
// This util function returns the page params if they're present else returns null
 | 
						|
function isPageParams() {
 | 
						|
	let webpageParams = null;
 | 
						|
	try {
 | 
						|
		// eslint-disable-next-line no-undef, camelcase
 | 
						|
		webpageParams = page_params;
 | 
						|
	} catch (err) {
 | 
						|
		webpageParams = null;
 | 
						|
	}
 | 
						|
	return webpageParams;
 | 
						|
}
 | 
						|
 | 
						|
module.exports = {
 | 
						|
	isPageParams
 | 
						|
};
 |