Skip to content
This repository was archived by the owner on Nov 2, 2023. It is now read-only.

Commit

Permalink
Merge pull request #39 from StrictlySkyler/bug/37/new-instance-no-lan…
Browse files Browse the repository at this point in the history
…es-never-loads

bug/37/new-instance-no-lanes-never-loads
  • Loading branch information
StrictlySkyler authored Jul 1, 2018
2 parents 84cf01f + d3aaf55 commit 4a75753
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion imports/ui/pages/lanes/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ Template.lanes.helpers({
let total = Session.get('total_lanes');
let current = Lanes.find().count();

if (! total || current < total) return true;
if (total !== 0 && ! total || current < total) return true;

return false;
},

empty () { return Session.get('total_lanes') === 0; },

lanes () {
let lanes;
let sort_by = Session.get('lanes_table_sort_by');
Expand Down
6 changes: 6 additions & 0 deletions imports/ui/pages/lanes/lanes.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ <h1>Lanes</h1>
</tr>
{{/if}}

{{#if empty}}
<tr class="empty">
<td colspan=9>No lanes found. <a href="/lanes/new/edit">Create the first.</a></td>
</tr>
{{/if}}

{{#each lanes}}
<tr>
<td class="name-column">
Expand Down
2 changes: 1 addition & 1 deletion imports/ui/pages/lanes/lib/util.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Shipments } from '../../../../api/shipments';

const count = (lane) => {
const count = (lane = { _id: false }) => {
return Shipments.find({ lane: lane._id }).count();
};

Expand Down

0 comments on commit 4a75753

Please sign in to comment.