pub async fn is_persistent() -> Result<bool, IdbError> {
        let storage_manager = web_sys::window().unwrap().navigator().storage();
        // If we can't access this, we're probably in a very old browser, so retrying
        // isn't worth it in all likelihood
        let persisted = storage_manager
            .persisted()
            .map_err(|_| IdbError::PersistenceCheckFailed { retry: false })?;
        let persisted = JsFuture::from(persisted)
            .await
            .map_err(|_| IdbError::PersistenceCheckFailed { retry: true })?;
        let persisted_bool = persisted
            .as_bool()
            .ok_or(IdbError::PersistenceCheckFailed { retry: true })?;

        Ok(persisted_bool)
    }
Checks if the storage is persistently stored. If it is, the browser
isn't allowed to clear it, the user would have to manually. This doesn't
provide a guarantee that all users who've been to your site before
will have previous state stored, you should assume that they could well
have cleared it manually (or with very stringent privacy settings).

If this returns an error, a recommendation about whether or not to retry
will be attached. You generally shouldn't retry this more than once if
there was an error.

For more information about persistent storage on the web, see [here](https://web.dev/persistent-storage).
packages/perseus/src/state/freeze_idb.rs