Browse Source

Load alternative main repo when 'repo=' parameter is used initially

master
parent
commit
e75d60b0c8
  1. 9
      src/index.js
  2. 5
      src/state.js

9
src/index.js

@ -18,6 +18,7 @@ global.baseCategory = null
global.overpassUrl = null
global.overpassFrontend = null
global.currentPath = null
global.mainRepo = ''
global.tabs = null
var lastPopupClose = 0
@ -109,7 +110,13 @@ function onload2 (initState) {
state.apply(newState)
OpenStreetBrowserLoader.getCategory('index', function (err, category) {
let repo = ''
if ('repo' in newState) {
mainRepo = newState.repo
repo = mainRepo + '/'
}
OpenStreetBrowserLoader.getCategory(repo + 'index', function (err, category) {
if (err) {
alert(err)
return

5
src/state.js

@ -5,6 +5,11 @@ var queryString = require('query-string')
function get () {
var state = {}
// repo
if (mainRepo !== '') {
state.repo = mainRepo
}
// path
if (currentPath) {
state.path = currentPath

Loading…
Cancel
Save