diff --git a/src/load-media-on-paste-or-drop.ts b/src/load-media-on-paste-or-drop.ts index 21f854f7d8..1d41d0fafe 100644 --- a/src/load-media-on-paste-or-drop.ts +++ b/src/load-media-on-paste-or-drop.ts @@ -44,9 +44,6 @@ export async function spawnFromFileList(files: FileList) { .then(function (response: UploadResponse) { const srcUrl = new URL(response.origin); srcUrl.searchParams.set("token", response.meta.access_token); - window.APP.store.update({ - uploadPromotionTokens: [{ fileId: response.file_id, promotionToken: response.meta.promotion_token }] - }); return { src: srcUrl.href, recenter: true, diff --git a/src/utils/bit-pinning-helper.ts b/src/utils/bit-pinning-helper.ts index a31d0dd1d9..1ff5b710c3 100644 --- a/src/utils/bit-pinning-helper.ts +++ b/src/utils/bit-pinning-helper.ts @@ -45,9 +45,5 @@ export const canPin = (hubChannel: HubChannel, eid: EntityID): boolean => { if (createMessageData.prefabName !== "media") { return false; } - const fileId = createMessageData.initialData.fileId; - const hasFile = !!fileId; - const hasPromotableFile = - hasFile && APP.store.state.uploadPromotionTokens.some((upload: any) => upload.fileId === fileId); - return isNetworkInstantiated(eid) && !isPinned(eid) && (!hasFile || hasPromotableFile); + return isNetworkInstantiated(eid) && hubChannel.can("pin_objects"); }; diff --git a/src/utils/entity-state-utils.ts b/src/utils/entity-state-utils.ts index 35f072b33d..de5158e00b 100644 --- a/src/utils/entity-state-utils.ts +++ b/src/utils/entity-state-utils.ts @@ -169,14 +169,8 @@ function createEntityStatePayload(world: HubsWorld, rootEid: EntityID): CreateEn if (prefabName == "media" && fileId && src) { const fileAccessToken = new URL(src).searchParams.get("token") as string; - const { promotionToken } = APP.store.state.uploadPromotionTokens.find( - (upload: { fileId: string }) => upload.fileId === fileId - ); - if (promotionToken) { - payload.file_id = fileId; - payload.file_access_token = fileAccessToken; - payload.promotion_token = promotionToken; - } + payload.file_id = fileId; + payload.file_access_token = fileAccessToken; } return payload; }