Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Fix Main window api broken by last release #67

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/src/lib/editor/engine/code/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class CodeManager {
}

viewInEditor(templateNode: TemplateNode) {
window.Main.invoke(MainChannels.OPEN_CODE_BLOCK, templateNode);
window.api.invoke(MainChannels.OPEN_CODE_BLOCK, templateNode);
}

async getStylesheet(webview: Electron.WebviewTag) {
Expand Down Expand Up @@ -93,7 +93,7 @@ export class CodeManager {

const tailwindResults = await this.getTailwindClasses(stylesheet);
const writeParams = await this.getWriteStyleParams(tailwindResults, webview);
const result = await window.Main.invoke(MainChannels.GET_STYLE_CODE, writeParams);
const result = await window.api.invoke(MainChannels.GET_STYLE_CODE, writeParams);

return (result || []) as CodeResult[];
}
Expand Down
11 changes: 1 addition & 10 deletions app/src/routes/project/LayersPanel/LayersTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,10 @@ const LayersTab = observer(() => {
};
}

function TreeNode({
node,
style,
dragHandle,
}: {
node: NodeApi;
style: React.CSSProperties;
dragHandle: React.RefObject<HTMLDivElement>;
}) {
function TreeNode({ node, style }: { node: NodeApi; style: React.CSSProperties }) {
return (
<div
style={style}
ref={dragHandle}
onClick={() => node.select()}
onMouseOver={() => handleHoverNode(node)}
className={clsx(
Expand Down
4 changes: 2 additions & 2 deletions app/src/routes/project/SharePopver/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ export default function SharePopover() {

async function startSharing() {
setLoading(true);
const res = await window.Main.invoke(MainChannels.OPEN_TUNNEL, 3000);
const res = await window.api.invoke(MainChannels.OPEN_TUNNEL, 3000);
setLoading(false);
setTunnel(res as TunnelResult);
}

async function stopSharing() {
setTunnel(undefined);
await window.Main.invoke(MainChannels.CLOSE_TUNNEL);
await window.api.invoke(MainChannels.CLOSE_TUNNEL);
}

function renderTunnelRunning(tunnel: TunnelResult) {
Expand Down