Skip to content

Commit

Permalink
Use default link values when adding CustomLink
Browse files Browse the repository at this point in the history
  • Loading branch information
tfedor committed Jun 21, 2024
1 parent 32c4ceb commit a9b8a15
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/js/Options/Modules/Options/Settings/CustomLinks.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import {onMount} from "svelte";
import {L} from "@Core/Localization/Localization";
import type {TCustomLink} from "../../../Data/_types";
import Settings from "../../../Data/Settings";
import Settings, {DefaultSettings} from "../../../Data/Settings";
import ToggleIcon from "../../Icons/ToggleIcon.svelte";
import {slide} from "svelte/transition";
import DeleteIcon from "../../Icons/DeleteIcon.svelte";
Expand All @@ -21,11 +21,15 @@
}
function addLink(): void {
const defaultLink: TCustomLink = type === "app"
? DefaultSettings.app_custom_link[0]!
: DefaultSettings.profile_custom_link[0]!
customLinks.push({
enabled: true,
name: "",
url: "",
icon: ""
enabled: defaultLink.enabled,
name: defaultLink.name,
url: defaultLink.url,
icon: defaultLink.icon
});
save();
}
Expand Down

0 comments on commit a9b8a15

Please sign in to comment.