Show reload notification on config update

This commit is contained in:
Shweelan Samson authored and Zaid Abdulla committed 2019-06-05 00:17:36 -07:00
1 parent 6c60ce6457
commit 83dba52e96
7 files changed
+122 -37

No files matched your search

+2
View File
@@ -41,6 +41,7 @@ koa.on("error", async err => {
koa.use(async (ctx, next) => {
const configSnapshot = await localCache.getCurrentSnapshot();
ctx.state.configSnapshot = configSnapshot;
ctx.set("X-Config-Snapshot", configSnapshot);
return next();
});
@@ -137,6 +138,7 @@ router.get("/", async ctx => {
window.clientConfig = ${JSON.stringify({
ui: localCache.getUiConfig(ctx.state.configSnapshot)
})};
window.configSnapshot = ${JSON.stringify(ctx.state.configSnapshot)};
window.username = ${JSON.stringify(
ctx.state.user ? ctx.state.user.username : ""
)};