SHARE
TWEET

Untitled

a guest Jun 18th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. isDesktopClassic() {
  2.         return UITheme.getUITheme() === "Theme3";
  3.     }
  4.      
  5. @AuraEnabled (cacheable=true)
  6. public static boolean getIsUserInClassic(){
  7.  
  8.     //Run class to see if the user is in Classic or Lightning
  9.     String themeDisplayed = UserInfo.getUiThemeDisplayed();
  10.  
  11.     //Boolean for Classic
  12.     boolean displayClassic = false;
  13.  
  14.     //Populate checkbox for handiness
  15.     if (themeDisplayed == 'Theme3'){
  16.         displayClassic = true;
  17.     }
  18.  
  19.     return displayClassic;                                  
  20.  
  21. }
  22.      
  23. import getIsUserInClassic from '@salesforce/apex/HelperClass.getIsUserInClassic';
  24.  
  25. export default class sampleClass extends NavigationMixin(LightningElement) {
  26.  
  27. @track isUserInClassic;
  28.  
  29. connectedCallback(){
  30.  
  31.         getIsUserInClassic()
  32.         .then(result => {
  33.             this.isUserInClassic = result;
  34.             this.error = undefined;
  35.         }).catch(error =>{
  36.             this.error = error;
  37.             this.isUserInClassic = undefined;
  38.         })
  39.  
  40. console.log(isUserInClassic);
  41.  
  42. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top