From c95981a35d4ae62e13b7683e6c2f04aaf85b496d Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 20 Apr 2020 23:10:33 +0200 Subject: [PATCH] remove unused code --- src/domain/session/SessionLoadViewModel.js | 43 ---------------------- 1 file changed, 43 deletions(-) delete mode 100644 src/domain/session/SessionLoadViewModel.js diff --git a/src/domain/session/SessionLoadViewModel.js b/src/domain/session/SessionLoadViewModel.js deleted file mode 100644 index 9bbd8863..00000000 --- a/src/domain/session/SessionLoadViewModel.js +++ /dev/null @@ -1,43 +0,0 @@ -import {EventEmitter} from "../../utils/EventEmitter.js"; -import {RoomTileViewModel} from "./roomlist/RoomTileViewModel.js"; -import {RoomViewModel} from "./room/RoomViewModel.js"; -import {SyncStatusViewModel} from "./SyncStatusViewModel.js"; - -export class SessionLoadViewModel extends ViewModel { - constructor(options) { - super(options); - this._sessionContainer = options.sessionContainer; - this._updateState(); - } - - onSubscribeFirst() { - this.track(this._sessionContainer.subscribe(this._updateState)); - } - - _updateState(previousState) { - const state = this._sessionContainer.state; - if (previousState !== LoadState.Ready && state === LoadState.Ready) { - this._sessionViewModel = new SessionViewModel(this.childOptions({ - sessionContainer: this._sessionContainer - })); - this.track(this._sessionViewModel); - } else if (previousState === LoadState.Ready && state !== LoadState.Ready) { - this.disposables.disposeTracked(this._sessionViewModel); - this._sessionViewModel = null; - } - this.emit(); - } - - get isLoading() { - const state = this._sessionContainer.state; - return state === LoadState.Loading || state === LoadState.InitialSync; - } - - get loadingLabel() { - switch (this._sessionContainer.state) { - case LoadState.Loading: return "Loading your conversations…"; - case LoadState.InitialSync: return "Getting your conversations from the server…"; - default: return null; - } - } -}