diff --git a/Makefile b/Makefile index bc6334b..274c3d3 100644 --- a/Makefile +++ b/Makefile @@ -11,5 +11,4 @@ start-server: build-client clean: docker compose down - -rm -r server/public/ client/dist/ - + rm -r server/public/ client/dist/ diff --git a/client/src/state.ts b/client/src/state.ts index 67c0955..13e3312 100644 --- a/client/src/state.ts +++ b/client/src/state.ts @@ -26,7 +26,6 @@ class AppState { tracks: Array state: State user?: LoggedInUser - source?: EventSource constructor() { this.tracks = new Array @@ -80,22 +79,16 @@ class AppState { window.location = window.location }) window.addEventListener('beforeunload', () => source.close()) - this.source = source } async repopulate() { - if (!this.user) { - this.tracks = [] - return - } this.state = State.Fetching this.tracks = await Track.fetchAll() - this.source?.close() - this.streamUpdatesFromServer() - this.state = State.Fetched } async populate() { if (this.state != State.Unfetched) return await this.repopulate() + this.streamUpdatesFromServer() + this.state = State.Fetched } async taskCompleted(track: Track, date: Date): Promise { const query = dateQuery(date) diff --git a/client/src/track.ts b/client/src/track.ts index 9893eca..83947a3 100644 --- a/client/src/track.ts +++ b/client/src/track.ts @@ -1,5 +1,4 @@ import { error } from "./error" -import { Tick, ITick } from './ticks' export interface ITrack { id?: number @@ -98,4 +97,4 @@ export class Track implements ITrack { } return [] } -} +} \ No newline at end of file diff --git a/client/src/views/Login.vue b/client/src/views/Login.vue index a50bf9d..2ef2efe 100644 --- a/client/src/views/Login.vue +++ b/client/src/views/Login.vue @@ -1,47 +1,32 @@