Skip to content

Commit

Permalink
Fixed Spotify code not loading if set to fixed color initially
Browse files Browse the repository at this point in the history
  • Loading branch information
zembrodt committed Dec 9, 2021
1 parent 96e43dd commit 451135e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Angular web application used to display your currently playing Spotify track wit

Can interface with an external API to hide Spotify client secret. See https://github.com/zembrodt/showtunes-api for an implementation in Go.

Application deployed to https://music.zembrodt.com
Application deployed to https://showtunes.app
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</div>
</div>
</ng-template>
<div *ngIf="(showSpotifyCode$ | async) && (!spotifyCodeUrl || !smartBackgroundColor || !smartBarColor); else spotifyCode">
<div *ngIf="(showSpotifyCode$ | async) && !spotifyCodeUrl; else spotifyCode">
<div class="qr-code-image">
<div class="qr-code-placeholder" [ngClass.lt-md]="'qr-code-placeholder-sm'"
fxLayout="column"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class AlbumDisplayComponent implements OnInit, OnDestroy {
}

private createSpotifyCodeUrl(backgroundColor, barColor: string): string {
if (this.track && this.track.uri) {
if (backgroundColor && barColor && this.track && this.track.uri) {
return SPOTIFY_CODES_URL + '?uri='
+ encodeURIComponent('jpeg/'
+ backgroundColor + '/'
Expand Down
1 change: 0 additions & 1 deletion src/app/components/color-picker/color-picker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export class ColorPickerComponent implements OnInit, OnDestroy {
}

onPresetColorSelect(presetColor: string): void {
console.log('Preset color selected: \'' + presetColor + '\'');
this.setColorChange(presetColor);
}

Expand Down

0 comments on commit 451135e

Please sign in to comment.