Show reload notification on config update
This commit is contained in:
1 parent
6c60ce6457
commit
83dba52e96
7 files changed
+122
-37
No files matched your search
@@ -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 : ""
|
||||
)};
|
||||
|
||||
Reference in new issue
Block a user