Commit 3bf492ba authored by Curtis Adam's avatar Curtis Adam

Fix the cardset template resetting the active card id if the user leaves the card editor view

parent 9826cba2
......@@ -183,6 +183,7 @@ export let CardEditor = class CardEditor {
Meteor.call("addCard", Router.current().params._id, subject, content1, content2, content3, content4, content5, content6, centerTextElement, date, Number(learningGoalLevel), Number(backgroundStyle), learningIndex, learningUnit, function (error, result) {
if (result) {
Bert.alert(TAPi18n.__('savecardSuccess'), "success", 'growl-top-left');
Session.set('activeCard', result);
if (returnToCardset) {
Router.go('cardsetdetailsid', {
_id: Router.current().params._id
......
......@@ -94,7 +94,7 @@ function changeCollapseIcon(iconId) {
*/
Template.cardset.onCreated(function () {
if (Session.get('activeCardset') === undefined || Session.get('activeCardset') !== Router.current().params._id) {
if (Session.get('activeCardset') === undefined || Session.get('activeCardset')._id !== Router.current().params._id) {
Session.set('activeCardset', Cardsets.findOne(Router.current().params._id));
Session.set('activeCard', undefined);
}
......
......@@ -44,7 +44,6 @@ module.exports = function () {
navigation.compareUrl(url, browser.getUrl());
});
this.Then(/^the card should be saved$/, function () {
navigation.clickElement("#leftCarouselControl");
navigation.compareContent(".detail" + (++countBeforeCreated), "FRONTOFTHECARD", 0);
});
this.Then(/^they log out$/, function () {
......
Markdown is supported
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