mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-27 08:15:42 +00:00
fix(settings): restore user preferences after loading project on startup
When loading a saved project on startup, applyLoadedProject() overwrites all editor state — including user preference settings like padding, aspect ratio, and export format — with potentially stale project values. The subsequent save effect then writes those stale values back to localStorage, effectively erasing the user's latest preferences. Now re-applies preference-level settings from localStorage after project load so that per-user settings (padding, border radius, aspect ratio, export format/quality/encoding, gif settings) survive across sessions. Fixes #197
This commit is contained in:
@@ -1587,6 +1587,21 @@ export default function VideoEditor() {
|
||||
currentProjectResult.path ?? null,
|
||||
);
|
||||
if (restored) {
|
||||
// Re-apply user preferences so stale project data does not
|
||||
// overwrite the last-used padding, aspect ratio, export
|
||||
// settings, etc. that were saved to localStorage.
|
||||
setPadding(initialEditorPreferences.padding);
|
||||
setBorderRadius(initialEditorPreferences.borderRadius);
|
||||
setAspectRatio(initialEditorPreferences.aspectRatio);
|
||||
setExportFormat(initialEditorPreferences.exportFormat);
|
||||
setMp4FrameRate(initialEditorPreferences.mp4FrameRate ?? DEFAULT_MP4_EXPORT_FRAME_RATE);
|
||||
setExportQuality(initialEditorPreferences.exportQuality);
|
||||
setExportEncodingMode(initialEditorPreferences.exportEncodingMode);
|
||||
setExportBackendPreference(initialEditorPreferences.exportBackendPreference);
|
||||
setExportPipelineModel(initialEditorPreferences.exportPipelineModel);
|
||||
setGifFrameRate(initialEditorPreferences.gifFrameRate);
|
||||
setGifLoop(initialEditorPreferences.gifLoop);
|
||||
setGifSizePreset(initialEditorPreferences.gifSizePreset);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user