Skip to content

Commit cbeb6ae

Browse files
committed
chore: remove debug statements
1 parent 23e8024 commit cbeb6ae

File tree

5 files changed

+3
-58
lines changed

5 files changed

+3
-58
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ localstorage.json
77
node_modules/
88
build/
99
/world*
10-
data/

src/client/components/ScriptEditor.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -142,22 +142,8 @@ export function ScriptEditor({ app, onHandle }) {
142142
newCode = script.code
143143
}
144144
}
145-
146-
// Check if editor content has unsaved changes
147-
// const currentCode = editor.getValue()
148-
// const hasUnsavedChanges = currentCode !== (app.script?.code ?? '// …')
149-
150-
// if (hasUnsavedChanges) {
151-
// // Ask user if they want to discard changes
152-
// const shouldDiscard = confirm('The script has been updated externally. Discard your local changes and load the new version?')
153-
// if (!shouldDiscard) return
154-
// }
155-
156-
// Update the editor with new content
157145
editor.setValue(newCode)
158146
codeRef.current = newCode
159-
160-
// Clear cached state since we're loading new content
161147
if (cached.key === key) {
162148
cached.value = newCode
163149
cached.viewState = null

src/core/createClientWorld.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ export function createClientWorld() {
4646
world.register('snaps', Snaps)
4747
world.register('wind', Wind)
4848
world.register('xr', XR)
49-
world.register('appServerClient', AppServerClient)
49+
if(env.PUBLIC_DEV_SERVER) world.register('appServerClient', AppServerClient)
5050
return world
5151
}

src/core/systems/AppServerClient.js

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ export class AppServerClient extends System {
2828

2929
init() {
3030
this.world.on('ready', () => {
31-
console.log("isAdmin", this.world.entities.player?.isAdmin())
32-
if (
33-
!(env.PUBLIC_DEV_SERVER === 'true') ||
34-
!this.world.entities.player?.isAdmin()
35-
) return
31+
if (!this.world.entities.player?.isAdmin()) return
3632

3733
this.setServerUrl("http://localhost:8080")
3834
this.worldUrl = this.world.network.apiUrl.split("/api")[0]
@@ -56,14 +52,6 @@ export class AppServerClient extends System {
5652
}
5753

5854
setServerUrl(url) {
59-
// Check if dev server feature is enabled
60-
console.log('[AppServerClient] Checking if dev server is enabled:', env.PUBLIC_DEV_SERVER)
61-
const isDevServerEnabled = env.PUBLIC_DEV_SERVER === 'true'
62-
if (!isDevServerEnabled) {
63-
console.log('[AppServerClient] Dev server feature is disabled, aborting setServerUrl')
64-
return
65-
}
66-
6755
console.log('[AppServerClient] Setting server URL:', url)
6856
const isWebSocket = url.startsWith('ws')
6957
console.log('[AppServerClient] isWebSocket:', isWebSocket)
@@ -489,12 +477,6 @@ export class AppServerClient extends System {
489477
* @returns {Promise<boolean>} - Success status
490478
*/
491479
async linkToDevServer(app) {
492-
// Check if dev server feature is enabled
493-
const isDevServerEnabled = env.PUBLIC_DEV_SERVER === 'true'
494-
if (!isDevServerEnabled) {
495-
throw new Error('Dev server feature is disabled')
496-
}
497-
498480
try {
499481
const { blueprint } = app
500482
let devServerApp = await fetch(`${this.url}/api/apps/${blueprint.name}`).then(res => res.json()).then(data => data.app)
@@ -568,12 +550,6 @@ export class AppServerClient extends System {
568550
* @returns {Promise<boolean>} - Success status
569551
*/
570552
async unlinkApps(appName) {
571-
// Check if dev server feature is enabled
572-
const isDevServerEnabled = env.PUBLIC_DEV_SERVER === 'true'
573-
if (!isDevServerEnabled) {
574-
throw new Error('Dev server feature is disabled')
575-
}
576-
577553
try {
578554

579555
await this.apiRequest(`/api/apps/${appName}/unlink`, {
@@ -595,12 +571,6 @@ export class AppServerClient extends System {
595571
*/
596572
async isLinked(blueprintId) {
597573
try {
598-
// Check if dev server feature is enabled
599-
const isDevServerEnabled = env.PUBLIC_DEV_SERVER === 'true'
600-
if (!isDevServerEnabled) {
601-
return false
602-
}
603-
604574
if (!this.connected || !this.url) {
605575
return false
606576
}

src/core/systems/ClientLoader.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,7 @@ export class ClientLoader extends System {
8989
const remoteUrl = this.world.resolveURL(url)
9090
const file = this.files.get(remoteUrl) ?? this.files.get(url)
9191
if (!file) return null
92-
if(this.files.has(url) && this.files.has(remoteUrl)) {
93-
console.log('debug: delete cache', remoteUrl)
94-
this.files.delete(url)
95-
}
92+
if(this.files.has(url) && this.files.has(remoteUrl)) this.files.delete(url) // delete `file://` entry
9693
return name ?
9794
new File([file], name, {
9895
type: file.type, // Preserve the MIME type
@@ -248,14 +245,7 @@ export class ClientLoader extends System {
248245
insert(type, url, file) {
249246
const key = `${type}/${url}`
250247
const localUrl = URL.createObjectURL(file)
251-
252-
// Store the file immediately for quick access
253-
console.log('debug: insert', { url, file })
254-
console.log(this.files)
255248
this.files.set(url, file)
256-
console.log('debug: inserted')
257-
console.log(this.files)
258-
259249
let promise
260250
if (type === 'hdr') {
261251
promise = this.rgbeLoader.loadAsync(localUrl).then(texture => {

0 commit comments

Comments
 (0)