Compare commits

..
Author SHA1 Message Date
Anthony Stirling 43137cde83 tests 2025-12-15 23:34:28 +00:00
Anthony Stirling 9ea2c94912 tests 2025-12-15 23:27:59 +00:00
Anthony Stirling ad33679c2b fix grandfather logs 2025-12-15 23:06:13 +00:00
Anthony Stirling c390f21114 minor stuff 2025-12-15 22:29:19 +00:00
Anthony Stirling b03ecef121 version bump 2025-12-15 22:15:32 +00:00
Anthony Stirling 3d9d2621fa fixes 2025-12-15 22:10:38 +00:00
Anthony Stirling 9c84e1eed4 Merge remote-tracking branch 'origin/main' into pdfCache 2025-12-15 21:58:35 +00:00
Anthony Stirling e424af1a31 several SAML 2025-12-15 21:57:59 +00:00
Anthony StirlingandGitHub 71d416ce90 Merge branch 'main' into pdfCache 2025-12-15 15:35:40 +00:00
Anthony Stirling 91cdd20b3f remove stuff 2025-12-13 16:48:35 +00:00
Anthony Stirling 235e68fa2b lint :) 2025-12-13 16:28:27 +00:00
Anthony Stirling 3279b28a76 fixes and cleanups 2025-12-13 13:56:24 +00:00
Anthony Stirling d95abcea95 missed commit 2025-12-10 23:26:46 +00:00
Anthony Stirling a73636a597 Cache fix issues 2025-12-10 23:26:35 +00:00
3 changed files with 3 additions and 21 deletions
@@ -51,8 +51,7 @@ class UserLicenseSettingsServiceTest {
when(applicationProperties.getPremium()).thenReturn(premium);
when(applicationProperties.getAutomaticallyGenerated()).thenReturn(automaticallyGenerated);
when(automaticallyGenerated.getIsNewServer())
.thenReturn(false); // Default: not a new server
when(automaticallyGenerated.getIsNewServer()).thenReturn(false); // Default: not a new server
when(settingsRepository.findSettings()).thenReturn(Optional.of(mockSettings));
when(userService.getTotalUsersCount()).thenReturn(80L);
when(settingsRepository.save(any(UserLicenseSettings.class)))
@@ -84,6 +84,7 @@ export function AppProviders({ children, appConfigRetryOptions, appConfigProvide
<ScarfTrackingInitializer />
<AppConfigLoader />
<FileContextProvider enableUrlSync={true} enablePersistence={true}>
<AppInitializer />
<BrandingAssetManager />
<ToolRegistryProvider>
<NavigationProvider>
@@ -92,7 +93,6 @@ export function AppProviders({ children, appConfigRetryOptions, appConfigProvide
<HotkeyProvider>
<SidebarProvider>
<ViewerProvider>
<AppInitializer />
<PageEditorProvider>
<SignatureProvider>
<RightRailProvider>
@@ -1,28 +1,20 @@
import { useEffect, useRef, useState } from 'react';
import { useEffect, useState } from 'react';
import { useOpenedFile } from '@app/hooks/useOpenedFile';
import { fileOpenService } from '@app/services/fileOpenService';
import { useFileManagement } from '@app/contexts/file/fileHooks';
import { useToolWorkflow } from '@app/contexts/ToolWorkflowContext';
import { useNavigationActions } from '@app/contexts/NavigationContext';
import { useViewer } from '@app/contexts/ViewerContext';
/**
* App initialization hook
* Desktop version: Handles Tauri-specific file initialization
* Requires FileContext - must be used inside FileContextProvider
* - Handles files opened with the app (adds directly to FileContext)
* - Opens single files in reader mode (collapsed tools for clean viewing)
*/
export function useAppInitialization(): void {
// Get file management actions
const { addFiles } = useFileManagement();
const { setReaderMode } = useToolWorkflow();
const { actions } = useNavigationActions();
const { setActiveFileIndex } = useViewer();
// Handle files opened with app (Tauri mode)
const { openedFilePaths, loading: openedFileLoading } = useOpenedFile();
const hasSetInitialReaderMode = useRef(false);
// Load opened files and add directly to FileContext
useEffect(() => {
@@ -54,15 +46,6 @@ export function useAppInitialization(): void {
if (filesArray.length > 0) {
await addFiles(filesArray);
console.log(`[Desktop] ${filesArray.length} opened file(s) added to FileContext`);
// Open single files in reader mode only on first app launch
if (filesArray.length === 1 && !hasSetInitialReaderMode.current) {
hasSetInitialReaderMode.current = true;
setReaderMode(true);
actions.setWorkbench('viewer');
setActiveFileIndex(0);
console.log('[Desktop] Opening in reader mode');
}
}
} catch (error) {
console.error('[Desktop] Failed to load opened files:', error);