desktop: handle MAC_APP_STORE is not defined error

This commit is contained in:
Abdullah Atta
2022-09-29 14:37:35 +05:00
parent 058431836d
commit 8a19fd8de5

View File

@@ -19,8 +19,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
const { contextBridge, ipcRenderer } = require("electron");
// eslint-disable-next-line no-undef
contextBridge.exposeInMainWorld("os", MAC_APP_STORE ? "mas" : process.platform);
let isMacAppStore =
// eslint-disable-next-line no-undef
process.env.NODE_ENV === "production" ? MAC_APP_STORE : false;
contextBridge.exposeInMainWorld("os", isMacAppStore ? "mas" : process.platform);
// Expose protected methods that allow the renderer process to use
// the ipcRenderer without exposing the entire object