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
16 changes: 10 additions & 6 deletions lib/services/importMap/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,23 @@ module.exports = (config) => {

config.utils.on('config:update:map', async (urlOrMapId) => {
const currentMap = await env.get(env.keys.MAP_URL)
if (currentMap && currentMap !== urlOrMapId) {
console.log(`Map value in config.yml has changed to ${urlOrMapId}, current map is ${currentMap}`)
console.log(`If you wish to apply this then call utils.importMap('${urlOrMapId}') manually or system.resetAllData() then restart server.`)
if (currentMap) {
if (currentMap !== urlOrMapId) {
console.log(`Map value in config.yml has changed to ${urlOrMapId}, current map is ${currentMap}`)
console.log(`If you wish to apply this then call utils.importMap('${urlOrMapId}') manually or system.resetAllData() then restart server.`)
}
return
}
await config.utils.importMap(urlOrMapId)
})

config.utils.on('config:update:mapFile', async (filePath) => {
const currentMap = await env.get(env.keys.MAP_URL)
if (currentMap && currentMap !== filePath) {
console.log(`Map value in config.yml has changed to ${filePath}, current map is ${currentMap}`)
console.log(`If you wish to apply this then call utils.importMapFile('${filePath}') manually or system.resetAllData() then restart server.`)
if (currentMap) {
if (currentMap !== filePath) {
console.log(`Map value in config.yml has changed to ${filePath}, current map is ${currentMap}`)
console.log(`If you wish to apply this then call utils.importMapFile('${filePath}') manually or system.resetAllData() then restart server.`)
}
return
}
await config.utils.importMapFile(filePath)
Expand Down