Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Empty file removed .gitignore
Empty file.
2 changes: 1 addition & 1 deletion api/pkg/group-challenge/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"golang.org/x/crypto/bcrypt"
)

// CreateUser creates a user with and hashes the password
// CreateUser creates a user with username and email and hashes the password
func CreateUser(username, password, email string) *models.User {
userModel := &models.User{
Username: username,
Expand Down
8 changes: 4 additions & 4 deletions api/pkg/group-challenge/liveparty/live-party-state.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (liveParty *LiveParty) Previous() {
return
}

if liveParty.Status.State == LivePartyStateSubmissions {
if liveParty.Status.State == LivePartyStateRunning {
liveParty.prevSubmission()
return
}
Expand Down Expand Up @@ -68,16 +68,16 @@ func (liveParty *LiveParty) prevReveal() {
}

func (liveParty *LiveParty) Next() {
if liveParty.Status.State == LivePartyStateWaitingLobby {
liveParty.Status.State = LivePartyStateSubmissions
if liveParty.Status.State == LivePartyStateLobby {
liveParty.Status.State = LivePartyStateRunning
}

if liveParty.Status.State == LivePartyStatePreReveal {
sortSequenceByVotes(liveParty)
liveParty.Status.State = LivePartyStateReveal
}

if liveParty.Status.State == LivePartyStateSubmissions {
if liveParty.Status.State == LivePartyStateRunning {
liveParty.nextSubmission()
return
}
Expand Down
16 changes: 8 additions & 8 deletions api/pkg/group-challenge/liveparty/live-party.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import (
)

var (
MaxStars = 6
LivePartyStateOpen = "open"
LivePartyStateWaitingLobby = "waitinglobby"
LivePartyStateSubmissions = "submissions"
LivePartyStatePreReveal = "prereveal"
LivePartyStateReveal = "reveal"
LivePartyStateDone = "done"
MaxStars = 6
LivePartyStateOpen = "open"
LivePartyStateLobby = "lobby"
LivePartyStateRunning = "running"
LivePartyStatePreReveal = "prereveal"
LivePartyStateReveal = "reveal"
LivePartyStateDone = "done"
)

type SubmissionStatus struct {
Expand Down Expand Up @@ -57,7 +57,7 @@ func createLiveParty(party *models.Party, con *pg.DB, livePartyConfig config.Liv
PartyStartTime: time.Now(),
SubmissionTimeMs: livePartyConfig.DefaultTimePerSubmissionSeconds * 1000,
Participants: 1,
State: LivePartyStateWaitingLobby,
State: LivePartyStateLobby,
Votes: []*models.Vote{},
},
ParticipantsUserIDs: []uuid.UUID{party.UserID},
Expand Down
86 changes: 32 additions & 54 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
"@headlessui/react": "2.2.10",
"@tanstack/react-query": "5.104.0",
"date-fns": "4.4.0",
"photoswipe": "^5.4.4",
"react": "19.3.0",
"react-date-picker": "12.1.0",
"react-dom": "19.3.0",
"react-hook-form": "7.89.0",
"react-icons": "5.7.0",
"react-photoswipe-gallery": "^4.1.2",
"react-router": "8.4.0",
"react-router-dom": "7.18.4",
"react-toastify": "11.1.0",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function App() {
<div className="print:bg-white bg-slate-100 dark:bg-slate-800 dark:text-white min-h-screen">
<Navigation />
<ToastContainer position="bottom-right" className="text-black" />
<div className="container mx-auto px-4">{session ? <WithUser /> : <WithoutUser />}</div>
<div className="container mx-auto">{session ? <WithUser /> : <WithoutUser />}</div>
</div>
</div>
</WebSocketContext.Provider>
Expand Down
11 changes: 9 additions & 2 deletions frontend/src/api/api-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@ export interface PartySubmissionFormData {
description: string;
}

export type PartyStatusState = 'open' | 'waitinglobby' | 'submissions' | 'prereveal' | 'reveal' | 'done';
export enum PartyStatusState {
OPEN = 'open',
LOBBY = 'lobby',
RUNNING = 'running',
PRE_REVEAL = 'prereveal',
REVEAL = 'reveal',
DONE = 'done',
}

export interface PartyStatusResponse {
current?: {
Expand All @@ -72,7 +79,7 @@ export interface PartyStatusResponse {
}

export function isPartyLive(partyStatus?: PartyStatusResponse) {
return partyStatus?.state !== 'open' && partyStatus?.state !== 'done';
return partyStatus?.state !== PartyStatusState.OPEN && partyStatus?.state !== PartyStatusState.DONE;
}

// session
Expand Down
Loading
Loading