app: close window when last tab is exited (#263)

This commit is contained in:
Martin Ek 2016-07-19 00:12:14 +02:00 committed by Guillermo Rauch
parent fa4033937e
commit 1214d26323

View file

@ -103,13 +103,10 @@ export function userExitSession (uid) {
type: SESSION_USER_EXIT, type: SESSION_USER_EXIT,
uid, uid,
effect () { effect () {
const { sessions } = getState().sessions; rpc.emit('exit', { uid });
if (sessions[uid]) { const sessions = keys(getState().sessions.sessions);
rpc.emit('exit', { uid }); if (!sessions.length) {
const sessions = keys(getState().sessions.sessions); window.close();
if (!sessions.length) {
window.close();
}
} }
} }
}); });