mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: use cordis to manage app lifecycle
This commit is contained in:
1 parent
d7ec26b772
commit
5b7067d77d
19 files changed
+307
-375
No files matched your search
@@ -237,10 +237,16 @@ export function apply(ctx) {
|
||||
ctx.Route('lang', '/l/:lang', LanguageHandler);
|
||||
ctx.Route('media', '/media', RichMediaHandler);
|
||||
ctx.on('app/started', buildUI);
|
||||
ctx.on('app/watch/change', buildUI);
|
||||
ctx.on('app/watch/unlink', buildUI);
|
||||
ctx.on('app/started', updateLogo);
|
||||
ctx.on('system/setting', updateLogo);
|
||||
ctx.on('app/watch/change', (path) => {
|
||||
if (!path.includes('/ui-default/') && !path.includes('/public/')) return;
|
||||
buildUI();
|
||||
});
|
||||
ctx.on('app/watch/unlink', (path) => {
|
||||
if (!path.includes('/ui-default/') && !path.includes('/public/')) return;
|
||||
buildUI();
|
||||
});
|
||||
buildUI();
|
||||
updateLogo();
|
||||
}
|
||||
Reference in new issue
Block a user