Skip to content

Commit a173d19

Browse files
authored
Merge pull request #303 from KenEucker/develop
Develop
2 parents 87485e1 + 2cc3efc commit a173d19

File tree

4 files changed

+20
-19
lines changed

4 files changed

+20
-19
lines changed

functions/autopost-background.mts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const autoPostNewBikeTags = async (): Promise<BackgroundProcessResults> =
4040

4141
if (gamesResponse.success) {
4242
const games = gamesResponse.data as unknown as Game[]
43+
log(`[autopost] found games`, games.length, 'info')
4344

4445
for (const game of games) {
4546
const autoPostSetting =
@@ -48,10 +49,10 @@ export const autoPostNewBikeTags = async (): Promise<BackgroundProcessResults> =
4849
: 0
4950

5051
if (autoPostSetting === 0) {
51-
log('autopost not set, skipping game', game.name)
52+
log('[autopost] autoposting not set, skipping game', game.name)
5253
continue
5354
} else {
54-
log(`autopost set to ${autoPostSetting} minutes, checking game`, game.name, 'info')
55+
log(`[autopost] autopost set to ${autoPostSetting} minutes, checking game`, game.name, 'info')
5556
}
5657

5758
const thisGameConfig = {
@@ -68,7 +69,7 @@ export const autoPostNewBikeTags = async (): Promise<BackgroundProcessResults> =
6869
const activeQueue = await getActiveQueueForGame(game, nonAdminBiketag)
6970

7071
if (activeQueue.completedTags.length && activeQueue.timedOutTags.length === 0) {
71-
log('completed tags found but none timed out', { game, activeQueue }, 'info')
72+
log('[autopost] completed tags found but none timed out', { game, activeQueue }, 'info')
7273
} else if (activeQueue.completedTags.length && activeQueue.timedOutTags.length) {
7374
const currentBikeTagResponse = await adminBiketag.getTag(undefined, { source: imageSource }) // the "current" mystery tag to be updated from the main album
7475
if (!currentBikeTagResponse.success) {
@@ -89,7 +90,7 @@ export const autoPostNewBikeTags = async (): Promise<BackgroundProcessResults> =
8990
)
9091

9192
if (autoSelectedWinningTag) {
92-
log('winning tag found, setting new BikeTag post', {
93+
log('[autopost] winning tag found, setting new BikeTag post', {
9394
game: game.slug,
9495
autoSelectedWinningTag,
9596
}, 'info')
@@ -107,7 +108,7 @@ export const autoPostNewBikeTags = async (): Promise<BackgroundProcessResults> =
107108
}
108109
}
109110
} else {
110-
log('couldnt get games', gamesResponse, 'error')
111+
log('[autopost] couldnt get games', gamesResponse, 'error')
111112
}
112113

113114
return {
@@ -120,13 +121,13 @@ export default async () => {
120121
const { results, errors } = await autoPostNewBikeTags()
121122

122123
if (results.length) {
123-
log('autopost attempted', { results }, 'info')
124+
log('[autopost] autopost attempted', { results }, 'info')
124125

125126
return new Response(JSON.stringify(results), {
126127
status: errors ? HttpStatusCode.BadRequest : HttpStatusCode.Ok,
127128
})
128129
} else {
129-
log('autopost ran', 'nothing to report', 'info')
130+
log('[autopost] autopost ran', 'nothing to report', 'info')
130131
return new Response('', {
131132
status: errors ? HttpStatusCode.BadRequest : HttpStatusCode.Ok,
132133
})

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"@vueuse/head": "^2.0.0",
3636
"ajv": "^8.17.1",
3737
"autoprefixer": "^10.4.17",
38-
"biketag": "^3.5.29",
38+
"biketag": "^3.5.30",
3939
"bootstrap": "^5.3.3",
4040
"bootstrap-vue-next": "^0.15.5",
4141
"crypto-js": "^4.2.0",
@@ -72,7 +72,7 @@
7272
"vue3-markdown-it": "^1.0.10"
7373
},
7474
"peerDependencies": {
75-
"biketag": "^3.5.29",
75+
"biketag": "^3.5.30",
7676
"pinia": "^2.0.0",
7777
"vue": "^3.0.0",
7878
"vue-router": "^4.0.0"

src/store/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ export const useBikeTagStore = defineStore(BikeTagDefaults.store, {
6464
fetchingData: false,
6565
dataFetched: false,
6666
credentialsFetched: false,
67-
auth0Token: '',
6867
lastCacheResetTime: 0,
6968
cacheResetInterval: parseInt(BikeTagEnv.CACHE_RESET_INTERVAL),
7069
gameName,
@@ -80,12 +79,13 @@ export const useBikeTagStore = defineStore(BikeTagDefaults.store, {
8079
players: [] as Player[],
8180
leaderboard: [] as Player[],
8281
formStep: BiketagQueueFormSteps.addFoundImage,
82+
mostRecentlyViewedTagnumber: getMostRecentlyViewedBikeTagTagnumber(0),
83+
regionPolygon: getRegionPolygonFromCookie(`${gameName}::regionPolygon`),
8384
// queuedTag: getQueuedTagFromCookie() ?? ({} as Tag),
8485
playerTag: {} as Tag,
86+
auth0Token: '',
8587
profile: getProfileFromCookie(),
8688
token: getTokenFromCookie(),
87-
mostRecentlyViewedTagnumber: getMostRecentlyViewedBikeTagTagnumber(0),
88-
regionPolygon: getRegionPolygonFromCookie(`${gameName}::regionPolygon`),
8989
}),
9090

9191
actions: {
@@ -761,9 +761,9 @@ export const useBikeTagStore = defineStore(BikeTagDefaults.store, {
761761
setProfileCookie(profile)
762762
debug(`${BikeTagDefaults.store}::profile`, profile)
763763
} else if (!profile) {
764-
setProfileCookie(profile)
764+
setProfileCookie()
765765
this.profile = getProfileFromCookie()
766-
debug(`${BikeTagDefaults.store}::profile`, profile)
766+
debug(`${BikeTagDefaults.store}::profile`, this.profile)
767767
}
768768

769769
return this.profile

0 commit comments

Comments
 (0)