Skip to content

Commit

Permalink
make shorthands work with >1 words 🐛
Browse files Browse the repository at this point in the history
  • Loading branch information
derhuerst committed Apr 1, 2018
1 parent 0d307b3 commit 133cb7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions commands/departures/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ const printDeps = async (allDeps, ctx) => {
}

const departures = async (ctx, next) => {
// `/a spichernstr` shorthand
if (ctx.args && ctx.args[0]) {
const station = await parseWhere(ctx.args[0], ctx)
// `/a u spichernstr` shorthand
if (ctx.args && ctx.args.length > 0) {
const station = await parseWhere(ctx.args.join(' '), ctx)
if (station) await ctx.storage.putData('where', station)
return next()
}
Expand Down
6 changes: 3 additions & 3 deletions commands/journeys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ const getFrequentStationKeys = async (ctx) => {
const journeys = async (ctx, next) => {
ctx.freqStationKeys = await getFrequentStationKeys(ctx)

// `/a spichernstr` shorthand
if (ctx.args && ctx.args[0]) {
const origin = await parseWhere(ctx.args[0], ctx)
// `/j u spichernstr` shorthand
if (ctx.args && ctx.args.length > 0) {
const origin = await parseWhere(ctx.args.join(' '), ctx)
if (origin) await ctx.storage.putData('origin', origin)
return next()
}
Expand Down

0 comments on commit 133cb7e

Please sign in to comment.