refactor: split tree shell state runtime

This commit is contained in:
lix-2026
2026-05-26 02:48:30 +08:00
parent e76fa437a3
commit b8a067ce9f
5 changed files with 86 additions and 52 deletions
@@ -952,6 +952,20 @@ pub async fn tree_shell_page_runtime_asset() -> Response {
.unwrap_or_else(|_| Response::new(Body::empty()))
}
pub async fn tree_shell_state_runtime_asset() -> Response {
const JS: &str = include_str!("../../browser/tree-shell-state-runtime.js");
Response::builder()
.status(StatusCode::OK)
.header(
header::CONTENT_TYPE,
"application/javascript; charset=utf-8",
)
.header(header::CACHE_CONTROL, "no-store")
.header(HEADER_MNOTE_WEB_OWNER, "mnote-web")
.body(Body::from(JS))
.unwrap_or_else(|_| Response::new(Body::empty()))
}
pub async fn tree_shell_icons_runtime_asset() -> Response {
const JS: &str = include_str!("../../browser/tree-shell-icons-runtime.js");
Response::builder()