Commit 51dc5a6b authored by Hermann's avatar Hermann Committed by Hermann
Browse files

add message in case there are no sessions for a user

parent f7b23d6a
import m from 'mithril';
import { Card, Toolbar, ToolbarTitle, Button } from 'polythene-mithril';
import { Card, Toolbar, ToolbarTitle, Button, Snackbar } from 'polythene-mithril';
import { ListSelect, DatalistController } from 'amiv-web-ui-components';
import ItemView from '../views/itemView';
import TableView from '../views/tableView';
......@@ -165,10 +165,13 @@ export default class UserView extends ItemView {
this.sessionsHandler.get({
where: { user: this.data._id },
}).then((response) => {
response._items.forEach((session) => {
this.sessionsHandler.delete(session);
});
console.log(response);
if (response._items.length === 0) {
Snackbar.show({ title: 'No active sessions for this user.' });
} else {
response._items.forEach((session) => {
this.sessionsHandler.delete(session);
});
}
});
},
},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment