MCPcopy
hub / github.com/CapSoftware/Cap / importDesktopBackground

Function importDesktopBackground

apps/desktop/src/routes/editor/ConfigSidebar.tsx:1880–1899  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1878 createSignal(false);
1879
1880 const importDesktopBackground = async () => {
1881 if (importingDesktopBackground()) return;
1882 setImportingDesktopBackground(true);
1883 try {
1884 const path = await commands.importCurrentDesktopBackground(
1885 editorInstance.path,
1886 );
1887 const addingFromBlankBackground = isNoneBackground();
1888 batch(() => {
1889 setCurrentDesktopBackgroundPath(path);
1890 setBackgroundSourceTab("desktop");
1891 setWallpaperSource(path);
1892 ensureBackgroundPresentation(addingFromBlankBackground);
1893 });
1894 } catch (_err) {
1895 toast.error("Couldn't import your desktop wallpaper");
1896 } finally {
1897 setImportingDesktopBackground(false);
1898 }
1899 };
1900
1901 const renderBackgroundSourceIcon = (item: BackgroundSourceTab) => {
1902 if (item === "none") {

Callers

nothing calls this directly

Calls 3

isNoneBackgroundFunction · 0.85
setWallpaperSourceFunction · 0.70

Tested by

no test coverage detected