forked from CIT/Vmeda.Online
		
	MOBILE-3320 core: Check WP Enabled
This commit is contained in:
		
							parent
							
								
									1d5fbb3bd7
								
							
						
					
					
						commit
						8eedb2afac
					
				@ -70,7 +70,6 @@ export class CoreSitesProvider {
 | 
			
		||||
    protected static readonly VALID_VERSION = 1;
 | 
			
		||||
    protected static readonly INVALID_VERSION = -1;
 | 
			
		||||
 | 
			
		||||
    protected isWPApp = false;
 | 
			
		||||
    protected logger: CoreLogger;
 | 
			
		||||
    protected services = {};
 | 
			
		||||
    protected sessionRestored = false;
 | 
			
		||||
@ -639,21 +638,28 @@ export class CoreSitesProvider {
 | 
			
		||||
    protected validateWorkplaceVersion(info: CoreSiteInfoResponse): number {
 | 
			
		||||
        const isWorkplace = !!info.functions && info.functions.some((func) => func.name == 'tool_program_get_user_programs');
 | 
			
		||||
 | 
			
		||||
        if (typeof this.isWPApp == 'undefined') {
 | 
			
		||||
            this.isWPApp = false; // @todo
 | 
			
		||||
        }
 | 
			
		||||
        const isWPEnabled = this.isWorkplaceEnabled();
 | 
			
		||||
 | 
			
		||||
        if (!this.isWPApp && isWorkplace) {
 | 
			
		||||
        if (!isWPEnabled && isWorkplace) {
 | 
			
		||||
            return CoreSitesProvider.WORKPLACE_APP;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (this.isWPApp && !isWorkplace) {
 | 
			
		||||
        if (isWPEnabled && !isWorkplace) {
 | 
			
		||||
            return CoreSitesProvider.MOODLE_APP;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return CoreSitesProvider.VALID_VERSION;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Check if the app is workplace enabled.
 | 
			
		||||
     *
 | 
			
		||||
     * @return If the app is workplace enabled.
 | 
			
		||||
     */
 | 
			
		||||
    protected isWorkplaceEnabled(): boolean {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Returns the release number from site release info.
 | 
			
		||||
     *
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user