Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement