()
| 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") { |
nothing calls this directly
no test coverage detected