Skip to content

Commit

Permalink
remove url prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
ccaven committed Jul 24, 2023
1 parent 2127cea commit e646a02
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/lib/CodeEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
}
#editor { grid-column: 1; overflow: auto; border-left: 1px solid gray; }
#result { grid-column: 2; }
#result { grid-column: 2; background-color: white;}
#examples {
grid-column: 1 / 3;
Expand Down
1 change: 0 additions & 1 deletion src/lib/Examples.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<script lang="ts">
import { getContext } from "svelte";
import examples from "./all_examples.json";
let exampleSetter = getContext<(code: string) => void>("example-setter");
Expand Down
3 changes: 1 addition & 2 deletions src/lib/InviteLink.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<script lang='ts'>
export let inviteLink: string;
const pathPrefix = process.env.NODE_ENV === "production" ? "/code-together" : "";
let copyUrl = pathPrefix + "/copy.png"
let copyUrl = "/copy.png"
function onClick() {
navigator.clipboard.writeText(inviteLink);
Expand Down
6 changes: 2 additions & 4 deletions src/lib/sandbox.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import Sandbox, { type Options } from 'websandbox';

const pathPrefix = process.env.NODE_ENV === "production" ? "/code-together" : "";

export async function initSandbox(frameContainer: HTMLDivElement) {
const localApi = {
makeWorkerScript: async() => await fetch(pathPrefix + "/_worker.js").then(t=>t.blob()).then(t=>t.text())
makeWorkerScript: async() => await fetch("/_worker.js").then(t=>t.blob()).then(t=>t.text())
};

const sandboxOptions: Options = {
Expand All @@ -14,7 +12,7 @@ export async function initSandbox(frameContainer: HTMLDivElement) {

const sandbox = await Sandbox.create(localApi, sandboxOptions).promise;

await sandbox.importScript(pathPrefix + "/_sandbox.js");
await sandbox.importScript("/_sandbox.js");

return {
reload(code: string) {
Expand Down

0 comments on commit e646a02

Please sign in to comment.