Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat: Only require sign in, not pro

Richie McIlroyfdcef78b341b
diff --git a/apps/desktop/src-tauri/src/recording.rs b/apps/desktop/src-tauri/src/recording.rs
index ce2b59d4f..df9652735 100644
--- a/apps/desktop/src-tauri/src/recording.rs
+++ b/apps/desktop/src-tauri/src/recording.rs
@@ -132,9 +132,9 @@ pub async fn start_recording(
if matches!(state.recording_options.mode, RecordingMode::Instant) {
match AuthStore::get(&app) {
- Ok(Some(auth)) if auth.is_upgraded() => {
- // Pre-create the video and get the shareable link
- if let Ok(s3_config) = get_s3_config(&app, false, None).await {
+ Ok(Some(auth)) => {
+ if auth.is_upgraded() && get_s3_config(&app, false, None).await.is_ok() {
+ let s3_config = get_s3_config(&app, false, None).await.unwrap();
let link = web_api::make_url(format!("/s/{}", s3_config.id()));
state.pre_created_video = Some(PreCreatedVideo {
@@ -144,10 +144,13 @@ pub async fn start_recording(
});
info!("Pre-created shareable link: {}", link);
- };
+ }
+ // Allow the recording to proceed without error for any signed-in user
}
_ => {
- Err("Instant recording requires Cap Pro")?;
+ // User is not signed in
+ ShowCapWindow::SignIn.show(&app).ok();
+ Err("Please sign in to use instant recording")?;
}
}
}
diff --git a/apps/desktop/src/App.tsx b/apps/desktop/src/App.tsx
index 1399fbc91..362ad789c 100644
--- a/apps/desktop/src/App.tsx
+++ b/apps/desktop/src/App.tsx
@@ -2,7 +2,6 @@ import { Router, useCurrentMatches } from "@solidjs/router";
import { FileRoutes } from "@solidjs/start/router";
import {
createEffect,
- createResource,
ErrorBoundary,
onCleanup,
onMount,
@@ -26,7 +25,6 @@ import {
import { Button } from "@cap/ui-solid";
import { Toaster } from "solid-toast";
import { initAnonymousUser } from "./utils/analytics";
-import { initializeTitlebar } from "./utils/titlebar-state";
const queryClient = new QueryClient({
defaultOptions: {
diff --git a/apps/desktop/src/components/ModeSelect.tsx b/apps/desktop/src/components/ModeSelect.tsx
index 0af790cb8..864ed483a 100644
--- a/apps/desktop/src/components/ModeSelect.tsx
+++ b/apps/desktop/src/components/ModeSelect.tsx
@@ -55,12 +55,20 @@ const ModeOption = (props: ModeOptionProps) => {
);
};
-const ModeSelect = () => {
+interface ModeSelectProps {
+ initialMode?: "instant" | "studio";
+ onModeChange?: (mode: "instant" | "studio") => void;
+}
+
+const ModeSelect = (props: ModeSelectProps) => {
const { options, setOptions } = createOptionsQuery();
const handleModeChange = (mode: RecordingMode) => {
- if (!options.data) return;
- setOptions.mutate({ ...options.data, mode });
+ if (props.onModeChange) {
+ props.onModeChange(mode);
+ } else if (options.data) {
+ setOptions.mutate({ ...options.data, mode });
+ }
};
const modeOptions = [
@@ -94,7 +102,11 @@ const ModeSelect = () => {
darkimg={option.darkimg}
lightimg={option.lightimg}
icon={option.icon}
- isSelected={options.data?.mode === option.mode}
+ isSelected={
+ props.initialMode
+ ? props.initialMode === option.mode
+ : options.data?.mode === option.mode
+ }
onSelect={handleModeChange}
/>
))}
diff --git a/apps/desktop/src/routes/(window-chrome)/setup.tsx b/apps/desktop/src/routes/(window-chrome)/setup.tsx
index 32c8c10b7..2f4d0e5e1 100644
--- a/apps/desktop/src/routes/(window-chrome)/setup.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/setup.tsx
@@ -112,7 +112,7 @@ export default function () {
<Show when={currentStep() === "permissions"}>
<div class="flex flex-col items-center">
- <IconCapLogo class="size-18 mb-3" />
+ <IconCapLogo class="size-14 mb-3" />
<h1 class="text-[1.2rem] font-[700] mb-1 text-[--text-primary]">
Permissions Required
</h1>
@@ -172,7 +172,7 @@ export default function () {
<Show when={currentStep() === "mode"}>
<div class="flex flex-col items-center">
- <IconCapLogo class="size-18 mb-3" />
+ <IconCapLogo class="size-14 mb-3" />
<h1 class="text-[1.2rem] font-[700] mb-1 text-[--text-primary]">
Select Recording Mode
</h1>