fix(coderd): improve use case handling in notifier for appearance fetchers (#15242)

Fixing #15241 & add tests.
This commit is contained in:
Vincent Vielle
2024-10-28 16:53:20 +01:00
committed by GitHub
parent 03940f5fef
commit 95a348ecc7
2 changed files with 239 additions and 0 deletions

View File

@ -38,6 +38,10 @@ func (n *notifier) fetchAppName(ctx context.Context) (string, error) {
}
return "", xerrors.Errorf("get application name: %w", err)
}
if appName == "" {
appName = notificationsDefaultAppName
}
return appName, nil
}
@ -49,5 +53,9 @@ func (n *notifier) fetchLogoURL(ctx context.Context) (string, error) {
}
return "", xerrors.Errorf("get logo URL: %w", err)
}
if logoURL == "" {
logoURL = notificationsDefaultLogoURL
}
return logoURL, nil
}