diff --git a/.github/workflows/docker-dev-image.yml b/.github/workflows/docker-dev-image.yml index b1042ee2..ba212cc6 100644 --- a/.github/workflows/docker-dev-image.yml +++ b/.github/workflows/docker-dev-image.yml @@ -35,6 +35,7 @@ jobs: uses: docker/build-push-action@v3 with: context: ./ + platforms: linux/amd64,linux/arm64 file: ./.docker/Dockerfile push: true build-args: diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 8e741106..9e018f88 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -35,6 +35,7 @@ jobs: uses: docker/build-push-action@v3 with: context: ./ + platforms: linux/amd64,linux/arm64 file: ./.docker/Dockerfile push: true build-args: diff --git a/plugins/events.client.ts b/plugins/events.client.ts index 504b1405..043911d9 100644 --- a/plugins/events.client.ts +++ b/plugins/events.client.ts @@ -92,11 +92,10 @@ export default defineNuxtPlugin(() => { } const getAll = () => { - getEventsAll().then((allEvents: ServerEvent[]) => { - if (allEvents.length) { - eventsStore.addList(allEvents); - cachedIdsStore.syncWithActive(allEvents.map(({ uuid }) => uuid)); - lockedIdsStore.syncWithActive(allEvents.map(({ uuid }) => uuid)); + getEventsAll().then((events: ServerEvent[]) => { + if (events.length) { + eventsStore.initialize(events); + cachedIdsStore.syncWithActive(events.map(({ uuid }) => uuid)); } else { // NOTE: clear cached events hardly eventsStore.removeAll(); diff --git a/stores/events.ts b/stores/events.ts index 1750a2f1..79312436 100644 --- a/stores/events.ts +++ b/stores/events.ts @@ -8,11 +8,14 @@ export const useEventStore = defineStore("useEventStore", { events: [] as ServerEvent[], }), actions: { + initialize(events: ServerEvent[]) { + this.events = events; + }, addList(events: ServerEvent[]) { events.forEach((event) => { const isExistedEvent = this.events.some((el) => el.uuid === event.uuid); if (!isExistedEvent) { - this.events.push(event); + this.events.unshift(event); } else { this.events = this.events.map((el) => { if (el.uuid !== event.uuid) {