Update src/client/helper/journey.ts
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
c8118fabe4
commit
b5918a47cb
@ -1,4 +1,4 @@
|
||||
import journey_wrapper from './types/wrapper';
|
||||
import journey_wrapper from '../types/wrapper';
|
||||
|
||||
/* LIST HELPERS */
|
||||
export const filter_selected = function (journey: journey_wrapper, list: geoloc[], step: boolean) {
|
||||
@ -39,3 +39,14 @@ export const journey_del_place = function (journey: journey_wrapper, tpe: String
|
||||
default: return true;
|
||||
}
|
||||
}
|
||||
|
||||
export const journey_from_url = function () {
|
||||
const path = window.location.pathname.slice(1).split('/')
|
||||
const hash = window.location.hash.slice(1).split('_')
|
||||
return {
|
||||
edit: ["view", "short"].indexOf(path.at(0) || "") == -1,
|
||||
id: path.at(-1) || String.gen_id(16).toString(),
|
||||
leg: parseInt(hash.at(0) || '0'),
|
||||
day: parseInt(hash.at(1) || '0')
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user