Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- isDesktopClassic() {
- return UITheme.getUITheme() === "Theme3";
- }
- @AuraEnabled (cacheable=true)
- public static boolean getIsUserInClassic(){
- //Run class to see if the user is in Classic or Lightning
- String themeDisplayed = UserInfo.getUiThemeDisplayed();
- //Boolean for Classic
- boolean displayClassic = false;
- //Populate checkbox for handiness
- if (themeDisplayed == 'Theme3'){
- displayClassic = true;
- }
- return displayClassic;
- }
- import getIsUserInClassic from '@salesforce/apex/HelperClass.getIsUserInClassic';
- export default class sampleClass extends NavigationMixin(LightningElement) {
- @track isUserInClassic;
- connectedCallback(){
- getIsUserInClassic()
- .then(result => {
- this.isUserInClassic = result;
- this.error = undefined;
- }).catch(error =>{
- this.error = error;
- this.isUserInClassic = undefined;
- })
- console.log(isUserInClassic);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement