From ecabfba13c98f52595ca4a85e54da8b066b05fcc Mon Sep 17 00:00:00 2001 From: ayn2op Date: Wed, 30 Apr 2025 13:22:55 -0400 Subject: [PATCH] refactor(config): remove notifications.go --- internal/config/config.go | 30 +++++++++++++++++++++++++----- internal/config/notifications.go | 25 ------------------------- 2 files changed, 25 insertions(+), 30 deletions(-) delete mode 100644 internal/config/notifications.go diff --git a/internal/config/config.go b/internal/config/config.go index 0e7e9fb..3c1a263 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -21,6 +21,17 @@ type ( UserAgent string `toml:"user_agent"` } + Notifications struct { + Enabled bool `toml:"enabled"` + Duration int `toml:"duration"` + Sound Sound `toml:"sound"` + } + + Sound struct { + Enabled bool `toml:"enabled"` + OnlyOnPing bool `toml:"only_on_ping"` + } + Config struct { Mouse bool `toml:"mouse"` Editor string `toml:"editor"` @@ -33,9 +44,10 @@ type ( TimestampsFormat string `toml:"timestamps_format"` Identify Identify `toml:"identify"` - Keys Keys `toml:"keys"` - Theme Theme `toml:"theme"` Notifications Notifications `toml:"notifications"` + + Keys Keys `toml:"keys"` + Theme Theme `toml:"theme"` } ) @@ -58,9 +70,17 @@ func defaultConfig() *Config { UserAgent: consts.UserAgent, }, - Keys: defaultKeys(), - Theme: defaultTheme(), - Notifications: defaultNotifications(), + Notifications: Notifications{ + Enabled: true, + Duration: 500, + Sound: Sound{ + Enabled: true, + OnlyOnPing: true, + }, + }, + + Keys: defaultKeys(), + Theme: defaultTheme(), } } diff --git a/internal/config/notifications.go b/internal/config/notifications.go deleted file mode 100644 index d024f35..0000000 --- a/internal/config/notifications.go +++ /dev/null @@ -1,25 +0,0 @@ -package config - -type ( - Notifications struct { - Enabled bool `toml:"enabled"` - Duration int `toml:"duration"` - Sound Sound `toml:"sound"` - } - - Sound struct { - Enabled bool `toml:"enabled"` - OnlyOnPing bool `toml:"only_on_ping"` - } -) - -func defaultNotifications() Notifications { - return Notifications{ - Enabled: true, - Duration: 500, - Sound: Sound{ - Enabled: true, - OnlyOnPing: true, - }, - } -}