Skip to content

Commit

Permalink
Merge pull request #5924 from mozilla/delint
Browse files Browse the repository at this point in the history
delint
  • Loading branch information
johnshaughnessy authored Jan 31, 2023
2 parents 267e53b + 80dd83d commit 6672f85
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions src/scene-entry-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,22 +218,6 @@ export default class SceneEntryManager {
};

_setupMedia = () => {
const spawnMediaInfrontOfPlayer = (src, contentOrigin) => {
console.warn(
"Spawning newLoader object using `spawnMediaInFrontOfPlayer`. This codepath should likely be made more direct.",
src,
contentOrigin
);
if (useNewLoader) {
if (typeof src === "string") {
spawnFromUrl(src);
} else {
spawnFromFileList([src]);
}
} else {
spawnMediaInfrontOfPlayerAndReturn(src, contentOrigin).eid;
}
};
// HACK we only care about the return value in 1 spot, don't want to deal with that in the newLoader path
const spawnMediaInfrontOfPlayerAndReturn = (src, contentOrigin) => {
if (!this.hubChannel.can("spawn_and_move_media")) return;
Expand All @@ -257,6 +241,23 @@ export default class SceneEntryManager {
return entity;
};

const spawnMediaInfrontOfPlayer = (src, contentOrigin) => {
if (useNewLoader) {
console.warn(
"Spawning newLoader object using `spawnMediaInFrontOfPlayer`. This codepath should likely be made more direct.",
src,
contentOrigin
);
if (typeof src === "string") {
spawnFromUrl(src);
} else {
spawnFromFileList([src]);
}
} else {
spawnMediaInfrontOfPlayerAndReturn(src, contentOrigin).eid;
}
};

this.scene.addEventListener("add_media", e => {
const contentOrigin = e.detail instanceof File ? ObjectContentOrigins.FILE : ObjectContentOrigins.URL;

Expand Down

0 comments on commit 6672f85

Please sign in to comment.