From 3ba20dece1166182255082b2c4d5f7791dee855a Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Sat, 12 Oct 2019 22:18:08 +0200 Subject: [PATCH] fixup for delete button changes --- src/domain/SessionPickerViewModel.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/domain/SessionPickerViewModel.js b/src/domain/SessionPickerViewModel.js index 2fd25e22..97c07090 100644 --- a/src/domain/SessionPickerViewModel.js +++ b/src/domain/SessionPickerViewModel.js @@ -40,9 +40,9 @@ class SessionItemViewModel extends EventEmitter { get userId() { return this._sessionInfo.userId; } - - get lastUsed() { - return this._sessionInfo.lastUsed; + + get sessionInfo() { + return this._sessionInfo; } } @@ -51,7 +51,7 @@ export default class SessionPickerViewModel { this._storageFactory = storageFactory; this._sessionStore = sessionStore; this._sessionCallback = sessionCallback; - this._sessions = new SortedArray((s1, s2) => (s1.lastUsed || 0) - (s2.lastUsed || 0)); + this._sessions = new SortedArray((s1, s2) => (s1.sessionInfo.lastUsed || 0) - (s2.sessionInfo.lastUsed || 0)); } async load() { @@ -60,9 +60,9 @@ export default class SessionPickerViewModel { } pick(id) { - const session = this._sessions.array.find(s => s.id === id); - if (session) { - this._sessionCallback(session); + const sessionVM = this._sessions.array.find(s => s.id === id); + if (sessionVM) { + this._sessionCallback(sessionVM.sessionInfo); } }