Skip to content

Commit

Permalink
Merge pull request #1651 from rommapp/hotfix-gallery-ejs-perf
Browse files Browse the repository at this point in the history
[HOTFIX] Calculate gl support once on load
  • Loading branch information
gantoine authored Feb 23, 2025
2 parents 3d8342f + 602ea8b commit f32c55c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion backend/endpoints/responses/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class BaseCollectionSchema(BaseModel):

class CollectionSchema(BaseCollectionSchema):
id: int
url_cover: str
url_cover: str | None
rom_ids: set[int]
rom_count: int
user_id: int
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/__generated__/models/CollectionSchema.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/src/services/api/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { Collection, VirtualCollection } from "@/stores/collections";

export type UpdatedCollection = Collection & {
artwork?: File;
url_cover?: string;
url_cover?: string | null;
};

export const collectionApi = api;
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,10 @@ export function areThreadsRequiredForEJSCore(core: string): boolean {
return ["ppsspp"].includes(core);
}

const canvas = document.createElement("canvas");
const gl =
canvas.getContext("webgl") || canvas.getContext("experimental-webgl");

/**
* Check if EJS emulation is supported for a given platform.
*
Expand All @@ -430,10 +434,6 @@ export function isEJSEmulationSupported(
platformSlug: string,
heartbeat: Heartbeat,
) {
const canvas = document.createElement("canvas");
const gl =
canvas.getContext("webgl") || canvas.getContext("experimental-webgl");

return (
!heartbeat.EMULATION.DISABLE_EMULATOR_JS &&
getSupportedEJSCores(platformSlug).length > 0 &&
Expand Down

0 comments on commit f32c55c

Please sign in to comment.