diff --git a/modules/layout_builder/src/LayoutTempstoreRepository.php b/modules/layout_builder/src/LayoutTempstoreRepository.php
index 75c655cd..8013199f 100644
--- a/modules/layout_builder/src/LayoutTempstoreRepository.php
+++ b/modules/layout_builder/src/LayoutTempstoreRepository.php
@@ -74,12 +74,21 @@ class LayoutTempstoreRepository implements LayoutTempstoreRepositoryInterface {
     return !empty($tempstore['section_storage']);
   }
 
+  public function hasUnsavedChanges(SectionStorageInterface $section_storage) {
+    $key = $this->getKey($section_storage);
+    $tempstore = $this->getTempstore($section_storage)->get($key);
+    return !empty($tempstore['has_unsaved_changes']);
+  }
+
   /**
    * {@inheritdoc}
    */
-  public function set(SectionStorageInterface $section_storage) {
+  public function set(SectionStorageInterface $section_storage, $has_unsaved_changes = TRUE) {
     $key = $this->getKey($section_storage);
-    $this->getTempstore($section_storage)->set($key, ['section_storage' => $section_storage]);
+    $this->getTempstore($section_storage)->set($key, [
+      'section_storage' => $section_storage,
+      'has_unsaved_changes' => $has_unsaved_changes,
+    ]);
     // Update the storage in the static cache.
     $this->cache[$key] = $section_storage;
   }
