Add auth back to card image display

This commit is contained in:
Peter 2024-01-24 21:39:33 -05:00
parent c4d27b008b
commit 948bce5559
2 changed files with 6 additions and 6 deletions

View File

@ -5,7 +5,7 @@
<img style="max-height:485px; max-width: 100%;" id="team-image" :src="playerImageUrl" :alt="playerName"> <img style="max-height:485px; max-width: 100%;" id="team-image" :src="playerImageUrl" :alt="playerName">
<p><a id="bbref-link" target="_blank" :href="baseballReferenceUrl">Baseball Reference Page</a></p> <p><a id="bbref-link" target="_blank" :href="baseballReferenceUrl">Baseball Reference Page</a></p>
</div> </div>
<div class="col-sm-auto" style="width: 940px;"> <div class="col-sm-auto" v-visible="isAuthenticated" style="width: 940px;">
<div class="row"> <div class="row">
<img v-if="selectedCardImage1Url" style="height:485px; width: 940px;" id="card-image" <img v-if="selectedCardImage1Url" style="height:485px; width: 940px;" id="card-image"
:src="selectedCardImage1Url"> :src="selectedCardImage1Url">
@ -15,13 +15,13 @@
:src="selectedCardImage2Url"> :src="selectedCardImage2Url">
</div> </div>
<div class="row"> <div class="row">
<div v-visible="hasPreviousCard" class="col-sm-5"> <div v-visible="hasPreviousCard && isAuthenticated" class="col-sm-5">
<input type="button" class="w-100" @click="decrementCurrentSeasonNumber" value="<<" /> <input type="button" class="w-100" @click="decrementCurrentSeasonNumber" value="<<" />
</div> </div>
<strong class="col-sm-2" style="text-align: center;"> <strong class="col-sm-2" style="text-align: center;">
{{ getSeasonStringBySeasonNumber(currentSeasonNumber) }} {{ getSeasonStringBySeasonNumber(currentSeasonNumber) }}
</strong> </strong>
<div v-visible="hasNextCard" class="col-sm-5"> <div v-visible="hasNextCard && isAuthenticated" class="col-sm-5">
<input type="button" class="w-100" @click="incrementCurrentSeasonNumber" value=">>" /> <input type="button" class="w-100" @click="incrementCurrentSeasonNumber" value=">>" />
</div> </div>
</div> </div>
@ -67,12 +67,12 @@ export default {
return new Map(this.playerSeasons.map(ps => [ps.season, ps.image2])) return new Map(this.playerSeasons.map(ps => [ps.season, ps.image2]))
}, },
selectedCardImage1Url(): string | undefined { selectedCardImage1Url(): string | undefined {
if (!this.cardImage1UrlBySeasonNumber.has(this.currentSeasonNumber)) return undefined if (!this.isAuthenticated || !this.cardImage1UrlBySeasonNumber.has(this.currentSeasonNumber)) return undefined
return this.cardImage1UrlBySeasonNumber.get(this.currentSeasonNumber) return this.cardImage1UrlBySeasonNumber.get(this.currentSeasonNumber)
}, },
selectedCardImage2Url(): string | undefined { selectedCardImage2Url(): string | undefined {
if (!this.cardImage2UrlBySeasonNumber.has(this.currentSeasonNumber)) return undefined if (!this.isAuthenticated || !this.cardImage2UrlBySeasonNumber.has(this.currentSeasonNumber)) return undefined
return this.cardImage2UrlBySeasonNumber.get(this.currentSeasonNumber) return this.cardImage2UrlBySeasonNumber.get(this.currentSeasonNumber)
}, },

View File

@ -26,7 +26,7 @@ export function getOwnerId(): string | undefined {
export async function completeAuthentication(): Promise<void> { export async function completeAuthentication(): Promise<void> {
if (!window.location.hash) { if (!window.location.hash) {
console.warn('No token hash found in return URL') // console.warn('No token hash found in return URL')
return return
} }