I know there's ways in apex to detect if in sandbox or prod. What i'm looking to do is in my Aura component, show a link when i'm in a sandbox and show a different link when i'm in prod (not a sandbox) What is the best route?
Here are snippets of my code
Aura component/Controller.js
({
handleClick : function(component, event, helper) {
var caseId = component.get("v.recordId");
var action = component.get("c.sendOptyData");
action.setParams({ OptyName : OptyName });
action.setCallback(this, function(response) {
var state = response.getState();
if (state === "SUCCESS") {
var returnValue =response.getReturnValue();
//open new browser tab with URL below
window.open('https://yahoo.com');
}else if (state === "ERROR") {
helper.errorToast(response, component);
}
});
$A.enqueueAction(action);
}
})
I'm aware of code in apex like this:
public static Boolean isSandbox
{
get
{
return [select IsSandbox from Organization limit 1].IsSandbox;
}
}
What is the best route to have this translate over to the Aura component when showing different URL's? thanks!