Fix first local markdown open reload
This commit is contained in:
@@ -2826,6 +2826,8 @@ mod tests {
|
||||
assert!(!html.contains(r#"data-row-id="local:asset:attachments/report-a.pdf""#));
|
||||
assert!(html.contains(r#"data-testid="mnote-document-workspace""#));
|
||||
assert!(html.contains(r#"data-mnote-resource-tab-host="true""#));
|
||||
assert!(html.contains(r#"data-testid="mnote-leptos-tiptap-island-editor-root""#));
|
||||
assert!(html.contains(r#"data-pane-role="primary""#));
|
||||
assert!(html.contains("__MNOTE_DOCUMENT_PANES_BOOTSTRAP__"));
|
||||
assert!(html.contains(
|
||||
r#"<script type="module" src="/api/mnote-browser-runtime/document-editor-adapter-runtime.js"></script>"#
|
||||
|
||||
@@ -25,7 +25,7 @@ pub struct DocumentPaneViewModel {
|
||||
}
|
||||
|
||||
#[component]
|
||||
fn DocumentPane(model: DocumentPaneViewModel) -> impl IntoView {
|
||||
pub(super) fn DocumentPane(model: DocumentPaneViewModel) -> impl IntoView {
|
||||
let pane_hidden = !model.visible;
|
||||
let pane_role = model.pane_role.to_string();
|
||||
let pane_role_attr = pane_role.clone();
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
//! MNOTE 首页组件(Wolai 风格)
|
||||
|
||||
use super::layout::PageLayout;
|
||||
use super::{
|
||||
document::{DocumentPane, DocumentPaneViewModel},
|
||||
layout::PageLayout,
|
||||
};
|
||||
use leptos::prelude::*;
|
||||
|
||||
/// MNOTE 首页。
|
||||
@@ -61,6 +64,21 @@ pub fn HomePage(
|
||||
</main>
|
||||
}.into_any()
|
||||
} else {
|
||||
let empty_primary_model = DocumentPaneViewModel {
|
||||
pane_role: "primary",
|
||||
title: "文件夹".to_string(),
|
||||
document_id: String::new(),
|
||||
workspace_id: workspace_id.clone().unwrap_or_default(),
|
||||
page_wide_layout: false,
|
||||
page_small_text: false,
|
||||
page_layout_density: "normal".to_string(),
|
||||
page_font: "default".to_string(),
|
||||
page_show_heading_numbers: false,
|
||||
has_page_subtree: false,
|
||||
primary_legacy_ids: true,
|
||||
visible: true,
|
||||
hide_title_header: true,
|
||||
};
|
||||
view! {
|
||||
<main
|
||||
class="document-workspace mnote-workspace-empty-editor-host"
|
||||
@@ -87,14 +105,7 @@ pub fn HomePage(
|
||||
</div>
|
||||
<div class="mnote-main-tab-panels">
|
||||
<div data-mnote-page-tab-panel="true" data-pane-role="primary">
|
||||
<section
|
||||
class="document-pane mnote-workspace-empty-pane"
|
||||
data-document-pane="true"
|
||||
data-pane-role="primary"
|
||||
data-pane-workspace-id={workspace_id.clone().unwrap_or_default()}
|
||||
data-pane-visible="true"
|
||||
aria-label="主文档"
|
||||
></section>
|
||||
<DocumentPane model={empty_primary_model} />
|
||||
</div>
|
||||
<section
|
||||
class="mnote-resource-tab-host"
|
||||
|
||||
Reference in New Issue
Block a user