Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions lib/navigation/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ interface ViewData {
getContents: (path: string) => Promise<ContentsWithRoot>
/** The view icon as an inline svg */
icon: string
/** The view order */
order: number

/**
* The view order.
* If not set will be natural sorted by view name.
*/
order?: number

/**
* Custom params to give to the router on click
Expand Down Expand Up @@ -199,8 +203,8 @@ const isValidView = function(view: ViewData): boolean {
throw new Error('View icon is required and must be a valid svg string')
}

if (!('order' in view) || typeof view.order !== 'number') {
throw new Error('View order is required and must be a number')
if ('order' in view && typeof view.order !== 'number') {
throw new Error('View order must be a number')
}

// Optional properties
Expand Down