mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-02 21:13:32 +00:00
preload: use page_params only when it exists.
This PR adds a params-util.js file which checks wheather the page_params exists or not. Fixes: #517.
This commit is contained in:
15
app/renderer/js/utils/params-util.js
Normal file
15
app/renderer/js/utils/params-util.js
Normal file
@@ -0,0 +1,15 @@
|
||||
// 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
|
||||
};
|
||||
Reference in New Issue
Block a user