
import { Injectable } from '@angular/core';
import { Platform } from 'ionic-angular';
import { Storage } from '@ionic/storage';
/*
  Generated class for the SplitpaneProvider provider.

  See https://angular.io/guide/dependency-injection for more info on providers
  and Angular DI.
*/
@Injectable()
export class SplitpaneProvider {
  public splitPaneState: boolean;
  constructor(public platform: Platform,
    private storage: Storage) {
    this.splitPaneState = false;
  }

  getSplitPane() {

    if (localStorage.getItem('token')) {
      if (this.platform.width() > 850) {
        this.splitPaneState = true;
      } else {
        this.splitPaneState = false;
      }
    } else {
      this.splitPaneState = false;
    }
    return this.splitPaneState;
  }

}
