Skip to content
Merged
Changes from 5 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
8 changes: 5 additions & 3 deletions internal/pkg/apps/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func Install(ctx context.Context, clients *shared.ClientFactory, auth types.Slac
}
}
if iconPath != "" {
err = updateIcon(ctx, clients, iconPath, app.AppID, token)
err = updateIcon(ctx, clients, iconPath, app.AppID, token, manifest.IsFunctionRuntimeSlackHosted())
if err != nil {
clients.IO.PrintDebug(ctx, "icon error: %s", err)
_, _ = clients.IO.WriteOut().Write([]byte(style.SectionSecondaryf("Error updating app icon: %s", err)))
Expand Down Expand Up @@ -650,16 +650,18 @@ func appendLocalToDisplayName(manifest *types.AppManifest) {
}

// updateIcon will upload the new icon to the Slack API
func updateIcon(ctx context.Context, clients *shared.ClientFactory, iconPath, appID string, token string) error {
func updateIcon(ctx context.Context, clients *shared.ClientFactory, iconPath, appID string, token string, isHosted bool) error {
var span opentracing.Span
span, ctx = opentracing.StartSpanFromContext(ctx, "updateIcon")
defer span.Finish()

var err error
if clients.Config.WithExperimentOn(experiment.SetIcon) {
_, err = clients.API().IconSet(ctx, clients.Fs, token, appID, iconPath)
} else {
} else if isHosted {
_, err = clients.API().Icon(ctx, clients.Fs, token, appID, iconPath)
Comment thread
srtaalej marked this conversation as resolved.
} else {
return nil
}
if err != nil {
// TODO: separate the icon upload into a different function because if an error is returned
Expand Down
Loading