This commit is contained in:
parent
bdea14fc20
commit
fb2f6079cc
16 changed files with 508 additions and 9 deletions
|
|
@ -10,6 +10,7 @@ export module Catcrafts:Root_impl;
|
|||
import :Root;
|
||||
import :Views;
|
||||
import :Blog;
|
||||
import :Demo;
|
||||
import Crafter.Graphics;
|
||||
import std;
|
||||
|
||||
|
|
@ -17,6 +18,11 @@ using namespace Crafter;
|
|||
|
||||
namespace Catcrafts {
|
||||
void RenderRoot(const std::string_view route) {
|
||||
// Every route change replaces <main>'s innerHTML, which would
|
||||
// orphan the demo canvas if it's currently mounted inside a post.
|
||||
// Detach + hide it first; the post renderer re-mounts if needed.
|
||||
UnmountDemo();
|
||||
|
||||
std::string currentRoute = std::string(route);
|
||||
|
||||
if(currentRoute == "/blog" || currentRoute == "/") {
|
||||
|
|
|
|||
Loading…
Reference in a new issue