Skip to content
Draft
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
6 changes: 4 additions & 2 deletions desktop/src/features/agents/ui/AgentDefaultsEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import {
} from "@/features/agents/ui/AgentConfigFields";
import { cn } from "@/shared/lib/cn";
import { Button } from "@/shared/ui/button";
import { SettingsActionButton } from "@/features/settings/ui/SettingsActionButton";

type SaveState = "idle" | "saving" | "saved" | "error";

Expand Down Expand Up @@ -259,6 +260,7 @@ export function AgentDefaultsEditor({
const progressiveFieldsTransition = shouldReduceMotion
? { duration: 0 }
: PROGRESSIVE_FIELDS_TRANSITION;
const SaveButton = flatLayout ? SettingsActionButton : Button;

return (
<div className={cn("min-w-0", flatLayout ? "space-y-7" : "space-y-4")}>
Expand Down Expand Up @@ -337,7 +339,7 @@ export function AgentDefaultsEditor({
)}
<div className="ml-auto flex items-center gap-3">
{secondaryAction}
<Button
<SaveButton
disabled={
!dirty ||
!configIsValid ||
Expand All @@ -351,7 +353,7 @@ export function AgentDefaultsEditor({
<Loader className="mr-1.5 size-3.5 animate-spin" />
) : null}
Save defaults
</Button>
</SaveButton>
</div>
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import type {
UserProfileSummary,
} from "@/shared/api/types";
import { normalizePubkey, truncatePubkey } from "@/shared/lib/pubkey";
import { Button } from "@/shared/ui/button";
import { SettingsActionButton as Button } from "@/features/settings/ui/SettingsActionButton";
import {
DropdownMenu,
DropdownMenuContent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from "@/shared/api/customEmoji";
import { pickAndUploadMedia } from "@/shared/api/tauri";
import { rewriteRelayUrl } from "@/shared/lib/mediaUrl";
import { Button } from "@/shared/ui/button";
import { SettingsActionButton as Button } from "@/features/settings/ui/SettingsActionButton";
import { Input } from "@/shared/ui/input";
import { SettingsOptionGroup } from "@/features/settings/ui/SettingsOptionGroup";
import { SettingsSectionHeader } from "@/features/settings/ui/SettingsSectionHeader";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from "@/shared/constants/kinds";
import { useChannelsQuery } from "@/features/channels/hooks";
import { useIdentityQuery } from "@/shared/api/hooks";
import { Button } from "@/shared/ui/button";
import { SettingsActionButton as Button } from "@/features/settings/ui/SettingsActionButton";
import { Checkbox } from "@/shared/ui/checkbox";
import { Switch } from "@/shared/ui/switch";
import {
Expand Down
6 changes: 5 additions & 1 deletion desktop/src/features/notifications/lib/sound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,14 @@ export function shouldPlayNotificationSound(

const cache = new Map<SoundName, HTMLAudioElement>();

export function createNotificationSound(name: SoundName): HTMLAudioElement {
return new Audio(`/sounds/${name}.mp3`);
}

function getAudio(name: SoundName): HTMLAudioElement {
let audio = cache.get(name);
if (!audio) {
audio = new Audio(`/sounds/${name}.mp3`);
audio = createNotificationSound(name);
cache.set(name, audio);
}
return audio;
Expand Down
2 changes: 1 addition & 1 deletion desktop/src/features/settings/UpdateChecker.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { openUrl } from "@tauri-apps/plugin-opener";
import { useUpdaterContext } from "./hooks/UpdaterProvider";
import { Button } from "@/shared/ui/button";
import { SettingsActionButton as Button } from "./ui/SettingsActionButton";
import {
SettingsOptionGroup,
SettingsOptionRow,
Expand Down
Loading
Loading