Prechádzať zdrojové kódy

Merge pull request #4413 from Ben0it-T/fix-duplicate-board-create-board

Fix Duplicate board and create board from template doesn't open board
Lauri Ojansivu 3 rokov pred
rodič
commit
2f4e201d55

+ 6 - 1
client/components/boards/boardsList.js

@@ -228,6 +228,7 @@ BlazeComponent.extendComponent({
           evt.preventDefault();
         },
         'click .js-clone-board'(evt) {
+          let title = getSlug(Boards.findOne(this.currentData()._id).title) || 'cloned-board';
           Meteor.call(
             'copyBoard',
             this.currentData()._id,
@@ -242,7 +243,11 @@ BlazeComponent.extendComponent({
               } else {
                 Session.set('fromBoard', null);
                 subManager.subscribe('board', res, false);
-                Utils.goBoardId(res);
+                FlowRouter.go('board', {
+                  id: res,
+                  slug: title,
+                });
+                //Utils.goBoardId(res);
               }
             },
           );

+ 4 - 0
client/components/lists/listBody.js

@@ -719,6 +719,10 @@ BlazeComponent.extendComponent({
               (err, data) => {
                 _id = data;
                 subManager.subscribe('board', _id, false);
+                FlowRouter.go('board', {
+                  id: _id,
+                  slug: getSlug(element.title),
+                });
               },
             );
           }