You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/plugin/persisted-scope.mdx
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,28 @@ Install the persisted-scope plugin to get started.
66
66
</TabItem>
67
67
</Tabs>
68
68
69
+
:::caution
70
+
The `persisted-scope` plugin _must_ be registered and initialized after the `fs` plugin, as illustrated by the example below:
71
+
72
+
```rs
73
+
#[cfg_attr(mobile, tauri::mobile_entry_point)]
74
+
pubfnrun() {
75
+
tauri::Builder::default()
76
+
.plugin(tauri_plugin_fs::init()) // fs MUST BE before persisted scope!
77
+
.plugin(tauri_plugin_persisted_scope::init())
78
+
.run(tauri::generate_context!())
79
+
.expect("error while running tauri application");
80
+
}
81
+
```
82
+
83
+
**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:
84
+
85
+
```
86
+
Please make sure to register the `fs` plugin before the `persisted-scope` plugin!
87
+
```
88
+
89
+
:::
90
+
69
91
## Usage
70
92
71
93
After setup the plugin will automatically save and restore filesystem and asset scopes.
0 commit comments