lib/volt/page/page.rb
def load_stored_page
    if Volt.client?
      if `sessionStorage`
        page_obj_str = nil

        `page_obj_str = sessionStorage.getItem('___page');`
        `if (page_obj_str) {`
          `sessionStorage.removeItem('___page');`

          JSON.parse(page_obj_str).each_pair do |key, value|
            self.page.send(:"#{key}=", value)
          end
        `}`
      end
    end
  rescue => e
    puts "Unable to restore: #{e.inspect}"
  end
# When the page is reloaded from the backend, we store the $page.page, so we
# can reload the page in the exact same state.  Speeds up development.
When the page is reloaded from the backend, we store the $page.page, so we
can reload the page in the exact same state.  Speeds up development.
When the page is reloaded from the backend we store the $page . page so we can reload the page in the exact same state . Speeds up development .
def load_stored_page
    if Volt.client?
      if `sessionStorage`
        page_obj_str = nil
        `page_obj_str = sessionStorage.getItem('___page');`
        `if (page_obj_str) {`
          `sessionStorage.removeItem('___page');`
          JSON.parse(page_obj_str).each_pair do |key, value|
            self.page.send(:"#{key}=", value)
          end
        `}`
      end
    end
  rescue => e
    puts "Unable to restore: #{e.inspect}"
  end
def load_stored_page if Volt . client? if ` sessionStorage ` page_obj_str = nil ` page_obj_str = sessionStorage.getItem('___page'); ` ` if (page_obj_str) { ` ` sessionStorage.removeItem('___page'); ` JSON . parse ( page_obj_str ) . each_pair do | key , value | self . page . send ( :" #{ key } = " , value ) end ` } ` end end rescue => e puts "Unable to restore: #{e.inspect}" end
When the page is reloaded from the backend, we store the $page.page, so we
can reload the page in the exact same state.
When the page is reloaded from the backend we store the $page . page so we can reload the page in the exact same state .