Skip to content

Commit a6f6612

Browse files
committed
Config: Update Progressive Web App (PWA) flag usage and defaults
Signed-off-by: Michael Mayer <[email protected]>
1 parent 7d3978c commit a6f6612

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

internal/config/config_app.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import (
1111
"github.com/photoprism/photoprism/pkg/txt"
1212
)
1313

14+
// DefaultAppColor specifies the default app background and splash screen color.
15+
var DefaultAppColor = "#19191a"
16+
1417
// AppName returns the app name when installed on a device.
1518
func (c *Config) AppName() string {
1619
name := strings.TrimSpace(c.options.AppName)
@@ -58,10 +61,10 @@ func (c *Config) AppIcon() string {
5861
return defaultIcon
5962
}
6063

61-
// AppColor returns the app splash screen color when installed on a device.
64+
// AppColor returns the app background and splash screen color.
6265
func (c *Config) AppColor() string {
6366
if appColor := clean.Color(c.options.AppColor); appColor == "" {
64-
return "#000000"
67+
return DefaultAppColor
6568
} else {
6669
return appColor
6770
}

internal/config/config_app_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ func TestConfig_AppIcon(t *testing.T) {
4242
func TestConfig_AppColor(t *testing.T) {
4343
c := NewConfig(CliTestContext())
4444

45-
assert.Equal(t, "#000000", c.AppColor())
45+
assert.Equal(t, DefaultAppColor, c.AppColor())
4646
c.options.AppColor = "#aBC123"
4747
assert.Equal(t, "#abc123", c.AppColor())
48-
c.options.AppColor = ""
48+
c.options.AppColor = "#000000"
4949
assert.Equal(t, "#000000", c.AppColor())
50+
c.options.AppColor = ""
51+
assert.Equal(t, DefaultAppColor, c.AppColor())
5052
}
5153

5254
func TestConfig_AppIconsPath(t *testing.T) {

internal/config/flags.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -530,25 +530,25 @@ var Flags = CliFlags{
530530
}}, {
531531
Flag: &cli.StringFlag{
532532
Name: "app-name",
533-
Usage: "progressive web app `NAME` when installed on a device",
533+
Usage: "app `NAME` when installed as a Progressive Web App (PWA)",
534534
Value: "",
535535
EnvVars: EnvVars("APP_NAME"),
536536
}}, {
537537
Flag: &cli.StringFlag{
538538
Name: "app-mode",
539-
Usage: "progressive web app `MODE` (fullscreen, standalone, minimal-ui, browser)",
539+
Usage: "app display `MODE` (fullscreen, standalone, minimal-ui, browser)",
540540
Value: "standalone",
541541
EnvVars: EnvVars("APP_MODE"),
542542
}}, {
543543
Flag: &cli.StringFlag{
544544
Name: "app-icon",
545-
Usage: "home screen `ICON` (logo, app, crisp, mint, bold, square)",
545+
Usage: "home screen app `ICON` (logo, app, crisp, mint, bold, square)",
546546
EnvVars: EnvVars("APP_ICON"),
547547
}}, {
548548
Flag: &cli.StringFlag{
549549
Name: "app-color",
550-
Usage: "splash screen `COLOR` code",
551-
Value: "#000000",
550+
Usage: "app background and splash screen `COLOR`",
551+
Value: DefaultAppColor,
552552
EnvVars: EnvVars("APP_COLOR"),
553553
}}, {
554554
Flag: &cli.StringFlag{

0 commit comments

Comments
 (0)