Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions apps/code/src/main/services/updates/service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -686,21 +686,21 @@ describe("UpdatesService", () => {
expect(mockAutoUpdater.checkForUpdates).toHaveBeenCalled();
});

it("performs check every hour", async () => {
it("performs check every 24 hours", async () => {
await initializeService(service);

const initialCallCount =
mockAutoUpdater.checkForUpdates.mock.calls.length;

// Advance 1 hour
await vi.advanceTimersByTimeAsync(60 * 60 * 1000);
// Advance 24 hours
await vi.advanceTimersByTimeAsync(24 * 60 * 60 * 1000);

expect(mockAutoUpdater.checkForUpdates.mock.calls.length).toBe(
initialCallCount + 1,
);

// Advance another hour
await vi.advanceTimersByTimeAsync(60 * 60 * 1000);
// Advance another 24 hours
await vi.advanceTimersByTimeAsync(24 * 60 * 60 * 1000);

expect(mockAutoUpdater.checkForUpdates.mock.calls.length).toBe(
initialCallCount + 2,
Expand Down
2 changes: 1 addition & 1 deletion apps/code/src/main/services/updates/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class UpdatesService extends TypedEventEmitter<UpdatesEvents> {
private static readonly SERVER_HOST = "https://update.electronjs.org";
private static readonly REPO_OWNER = "PostHog";
private static readonly REPO_NAME = "code";
private static readonly CHECK_INTERVAL_MS = 60 * 60 * 1000; // 1 hour
private static readonly CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000; // 24 hours
private static readonly CHECK_TIMEOUT_MS = 60 * 1000; // 1 minute timeout for checks
private static readonly DISABLE_ENV_FLAG = "ELECTRON_DISABLE_AUTO_UPDATE";
private static readonly SUPPORTED_PLATFORMS = ["darwin", "win32"];
Expand Down
1 change: 0 additions & 1 deletion apps/code/src/renderer/features/auth/stores/authStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,6 @@ export const useAuthStore = create<AuthState>()(
needsProjectSelection: false,
needsScopeReauth: false,
hasCodeAccess: null,
hasCompletedOnboarding: false,
selectedPlan: null,
selectedOrgId: null,
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useAuthStore } from "@features/auth/stores/authStore";
import { SettingRow } from "@features/settings/components/SettingRow";
import { useSettingsStore } from "@features/settings/stores/settingsStore";
import { useFeatureFlag } from "@hooks/useFeatureFlag";
Expand All @@ -15,6 +16,20 @@ export function AdvancedSettings() {

return (
<Flex direction="column">
<SettingRow
label="Reset onboarding"
description="Re-run the onboarding tutorial on next app restart"
>
<Button
variant="soft"
size="1"
onClick={() =>
useAuthStore.setState({ hasCompletedOnboarding: false })
}
>
Reset
</Button>
</SettingRow>
<SettingRow
label="Clear application storage"
description="This will remove all locally stored application data"
Expand Down
Loading