Skip to content

Commit

Permalink
Fix some last usages of Page
Browse files Browse the repository at this point in the history
  • Loading branch information
cibernox committed Jan 10, 2025
1 parent d0b7bb3 commit 3f94b4f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts" context="module">
import { writable, type Writable } from "svelte/store"
import {
pageInfo,
pageAst,
selectedAstElementId,
parentOfSelectedAstElement,
Expand Down Expand Up @@ -189,7 +190,7 @@
}
$pageAst = [...$pageAst]
// Update in the server
$live.pushEvent("update_page_ast", { id: $page.id, ast: $pageAst })
$live.pushEvent("update_page_ast", { id: $pageInfo.id, ast: $pageAst })
}
}
Expand Down
9 changes: 5 additions & 4 deletions assets/svelte/utils/ast-manipulation.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { pageAst, isAstElement, findAstElement } from "$lib/stores/page"
import { pageInfo, pageAst, isAstElement, findAstElement } from "$lib/stores/page"
import { live as liveStore } from "$lib/stores/live"
import { get } from "svelte/store"
import type { AstNode, Page } from "$lib/types"
import type { AstNode, Page, PageInfo } from "$lib/types"
import { getParentNodeId } from "./ast-helpers"

export function updateNodeContent(node, text) {
Expand All @@ -12,9 +12,10 @@ export function updateNodeContent(node, text) {
}

export function updateAst() {
let currentPage: Page = get(page)
let info: PageInfo = get(pageInfo)
let ast: AstNode[] = get(pageAst)
let live = get(liveStore)
live.pushEvent("update_page_ast", { id: currentPage.id, ast: currentPage.ast })
live.pushEvent("update_page_ast", { id: info.id, ast })
}

export function deleteAstNode(astElementId: string) {
Expand Down

0 comments on commit 3f94b4f

Please sign in to comment.