Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

fix: skip autosavfe after initial save

Marc Seitz6fe71152016d
diff --git a/components/datarooms/settings/introduction-settings.tsx b/components/datarooms/settings/introduction-settings.tsx
index adb355d5..7ea3f1bf 100644
--- a/components/datarooms/settings/introduction-settings.tsx
+++ b/components/datarooms/settings/introduction-settings.tsx
@@ -504,6 +504,7 @@ export default function IntroductionSettings({
const isFeatureAvailable = isDataroomsPlus || isTrial;
const saveTimeoutRef = useRef<NodeJS.Timeout | null>(null);
const hasInitialLoadRef = useRef(false);
+ const skipNextAutosaveRef = useRef(false);
// Fetch current introduction settings from dataroom
useEffect(() => {
@@ -562,6 +563,7 @@ export default function IntroductionSettings({
} finally {
setIsFetching(false);
hasInitialLoadRef.current = true;
+ skipNextAutosaveRef.current = true;
}
};
@@ -608,6 +610,12 @@ export default function IntroductionSettings({
useEffect(() => {
if (!hasInitialLoadRef.current) return;
+ // Skip the first auto-save pass after initial load
+ if (skipNextAutosaveRef.current) {
+ skipNextAutosaveRef.current = false;
+ return;
+ }
+
if (saveTimeoutRef.current) {
clearTimeout(saveTimeoutRef.current);
}