Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Improve status checks and compression validation in editor

Richie McIlroy060e88ec6d2e
diff --git a/apps/desktop/src/routes/editor/Editor.tsx b/apps/desktop/src/routes/editor/Editor.tsx
index e8f452d8b..b6c7bab9a 100644
--- a/apps/desktop/src/routes/editor/Editor.tsx
+++ b/apps/desktop/src/routes/editor/Editor.tsx
@@ -74,9 +74,18 @@ export function Editor() {
const rawImportStatus = createMemo(() => {
const meta = rawMetaQuery.data;
if (!meta) return "loading" as const;
- const metaWithStatus = meta as { status?: { status: string } };
- if (metaWithStatus.status?.status === "InProgress")
+ if (
+ "inner" in meta &&
+ meta.inner &&
+ typeof meta.inner === "object" &&
+ "status" in meta.inner &&
+ meta.inner.status &&
+ typeof meta.inner.status === "object" &&
+ "status" in meta.inner.status &&
+ meta.inner.status.status === "InProgress"
+ ) {
return "importing" as const;
+ }
return "ready" as const;
});
diff --git a/apps/desktop/src/routes/editor/ExportPage.tsx b/apps/desktop/src/routes/editor/ExportPage.tsx
index 16d78ca5a..f6b34ce7e 100644
--- a/apps/desktop/src/routes/editor/ExportPage.tsx
+++ b/apps/desktop/src/routes/editor/ExportPage.tsx
@@ -160,6 +160,13 @@ export function ExportPage() {
{ name: "export_settings" },
);
+ const VALID_COMPRESSIONS: ExportCompression[] = [
+ "Maximum",
+ "Social",
+ "Web",
+ "Potato",
+ ];
+
const settings = mergeProps(_settings, () => {
const ret: Partial<Settings> = {};
if (hasTransparentBackground() && _settings.format === "Mp4")
@@ -168,6 +175,9 @@ export function ExportPage() {
ret.format = "Mp4";
else if (!["Mp4", "Gif"].includes(_settings.format)) ret.format = "Mp4";
+ if (!VALID_COMPRESSIONS.includes(_settings.compression))
+ ret.compression = "Maximum";
+
Object.defineProperty(ret, "organizationId", {
get() {
if (!_settings.organizationId && organisations().length > 0)