Skip to content

armgit / mimik

Public Imported from GitHub
0

🎬 A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots πŸ“–

feat(guides): persist screenshot edits metadata

Luis Ortiz5fc64ee3614a
diff --git a/src/core/guides/service.ts b/src/core/guides/service.ts
index dfc919b..248e81f 100644
--- a/src/core/guides/service.ts
+++ b/src/core/guides/service.ts
@@ -1,4 +1,5 @@
import { i18n } from '#imports';
+import type { ScreenshotEdits } from '@/core/screenshot/types';
import { db } from './db';
import type { Guide, Screenshot, Step } from './types';
@@ -163,6 +164,10 @@ export async function updateScreenshotBlob(screenshotId: string, blob: Blob): Pr
await db.screenshots.update(screenshotId, { blob });
}
+export async function updateScreenshotEdits(screenshotId: string, edits: ScreenshotEdits): Promise<void> {
+ await db.screenshots.update(screenshotId, { edits });
+}
+
export async function getScreenshotsForSteps(stepIds: string[]): Promise<Map<string, Screenshot>> {
const rows = await db.screenshots.where('id').anyOf(stepIds).toArray();
return new Map(rows.map((s) => [s.stepId, s]));