fix(web): just rebuild timeline on routing
basically don't delete draft when navigating
This commit is contained in:
parent
562dc22320
commit
9ffd5b6c4e
2 changed files with 49 additions and 49 deletions
|
@ -99,14 +99,14 @@ pub fn TimelineNavigation() -> impl IntoView {
|
|||
<input class="w-100"
|
||||
type="submit"
|
||||
class:hidden=move || !auth.get().present()
|
||||
class:active=move || use_location().pathname.get().ends_with("/home")
|
||||
// class:active=move || use_location().pathname.get().ends_with("/home")
|
||||
value="home timeline"
|
||||
/>
|
||||
</a>
|
||||
<a href="/web/server" >
|
||||
<input
|
||||
class="w-100"
|
||||
class:active=move || use_location().pathname.get().ends_with("/server")
|
||||
// class:active=move || use_location().pathname.get().ends_with("/server")
|
||||
type="submit"
|
||||
value="server timeline"
|
||||
/>
|
||||
|
|
|
@ -43,6 +43,21 @@ fn main() {
|
|||
</nav>
|
||||
<hr class="sep" />
|
||||
<div class="container mt-2 pt-2" >
|
||||
<div class="two-col" >
|
||||
<div class="col-side sticky" class:hidden=move || menu.get() >
|
||||
<LoginBox
|
||||
token_tx=set_cookie
|
||||
token=cookie
|
||||
username_tx=set_username
|
||||
username=username
|
||||
home_tl=home_tl
|
||||
/>
|
||||
<hr class="mt-1 mb-1" />
|
||||
<TimelineNavigation />
|
||||
<hr class="mt-1 mb-1" />
|
||||
<PostBox username=username />
|
||||
</div>
|
||||
<div class="col-main" class:w-100=move || menu.get() >
|
||||
<Router // TODO maybe set base="/web" ?
|
||||
trailing_slash=TrailingSlash::Redirect
|
||||
fallback=move || view! {
|
||||
|
@ -59,21 +74,6 @@ fn main() {
|
|||
{move || {
|
||||
view! {
|
||||
<main>
|
||||
<div class="two-col" >
|
||||
<div class="col-side sticky" class:hidden=move || menu.get() >
|
||||
<LoginBox
|
||||
token_tx=set_cookie
|
||||
token=cookie
|
||||
username_tx=set_username
|
||||
username=username
|
||||
home_tl=home_tl
|
||||
/>
|
||||
<hr class="mt-1 mb-1" />
|
||||
<TimelineNavigation />
|
||||
<hr class="mt-1 mb-1" />
|
||||
<PostBox username=username />
|
||||
</div>
|
||||
<div class="col-main" class:w-100=move || menu.get() >
|
||||
<Routes>
|
||||
<Route path="/web" view=About />
|
||||
|
||||
|
@ -85,13 +85,13 @@ fn main() {
|
|||
|
||||
<Route path="/" view=move || view! { <Redirect path="/web" /> } />
|
||||
</Routes>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
}
|
||||
}}
|
||||
</Router>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer>
|
||||
<div>
|
||||
<hr class="sep" />
|
||||
|
|
Loading…
Reference in a new issue