Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/content/docs/plugin/persisted-scope.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,28 @@ Install the persisted-scope plugin to get started.
</TabItem>
</Tabs>

:::caution
The `persisted-scope` plugin _must_ be registered and initialized after the `fs` plugin, as illustrated by the example below:

```rs
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_fs::init()) // fs MUST BE before persisted scope!
.plugin(tauri_plugin_persisted_scope::init())
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
```

**Not doing so will result in the persisted scope not working!** You should also see a warning message upon launching your app in dev mode, similar to this:

```
Please make sure to register the `fs` plugin before the `persisted-scope` plugin!
```

:::

## Usage

After setup the plugin will automatically save and restore filesystem and asset scopes.