Function deskulpt::commands::refresh_widget_collection
source ยท pub(crate) fn refresh_widget_collection<R: Runtime>(
app_handle: AppHandle<R>,
) -> Result<HashMap<String, Result<WidgetConfig, String>>, String>
Expand description
Command for refreshing the state of the widget collection.
This command will scan through the widget base directory and update the current widget collection state with the new widgets found. It will also return the updated widget collection, intended to be used by the frontend to refresh the rendering of the widgets.
This command will fail if:
- There is an error reading the widget base directory.
- There is an error getting some entry in the widget base directory.
- There is an error inferring the widget ID from the path of the entry.
Note that failure to load a widget configuration will not lead to an overall failure of the command. Instead, the widget ID will correspond to an error message instead of a widget configuration.