Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions apps/desktop/src/routes/editor/ConfigSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,12 @@ function BackgroundConfig(props: { scrollRef: HTMLDivElement }) {
}));
});

// set padding if background is selected
const ensurePaddingForBackground = () => {
if (project.background.padding === 0)
setProject("background", "padding", 10);
};

// Validate background source path on mount
onMount(async () => {
if (
Expand Down Expand Up @@ -784,6 +790,7 @@ function BackgroundConfig(props: { scrollRef: HTMLDivElement }) {
value={project.background.source.type}
onChange={(v) => {
const tab = v as BackgroundSource["type"];
ensurePaddingForBackground();
switch (tab) {
case "image": {
setProject("background", "source", {
Expand Down Expand Up @@ -1017,6 +1024,8 @@ function BackgroundConfig(props: { scrollRef: HTMLDivElement }) {
// Get the raw path without any URL prefixes

debouncedSetProject(wallpaper.rawPath);

ensurePaddingForBackground();
} catch (err) {
toast.error("Failed to set wallpaper");
}
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/utils/createPresets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function createPresets() {
query,
createPreset: async (preset: CreatePreset) => {
const config = { ...preset.config };
// @ts-ignore we reeeally don't want the timeline in the preset
// @ts-expect-error we reeeally don't want the timeline in the preset
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was done by Biome automatically. Although it's outside of the changes on this PR gonna keep it.

config.timeline = undefined;

await updatePresets((store) => {
Expand Down
Loading