@dcrackel/hematournamentui 1.0.607 → 1.0.608

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36520,6 +36520,7 @@ const $m = /* @__PURE__ */ oe(tF, [["render", wF]]), yF = {
36520
36520
  },
36521
36521
  data() {
36522
36522
  return {
36523
+ localBouts: this.bouts,
36523
36524
  showDirectorModal: !1,
36524
36525
  showEditBoutModal: !1,
36525
36526
  selectedBout: {},
@@ -36530,9 +36531,10 @@ const $m = /* @__PURE__ */ oe(tF, [["render", wF]]), yF = {
36530
36531
  },
36531
36532
  watch: {
36532
36533
  bouts: {
36533
- handler() {
36534
- this.$forceUpdate();
36534
+ handler(n) {
36535
+ this.localBouts = n;
36535
36536
  },
36537
+ immediate: !0,
36536
36538
  deep: !0
36537
36539
  }
36538
36540
  },
@@ -36543,6 +36545,9 @@ const $m = /* @__PURE__ */ oe(tF, [["render", wF]]), yF = {
36543
36545
  window.removeEventListener("resize", this.handleResize);
36544
36546
  },
36545
36547
  computed: {
36548
+ currentSelectedBout() {
36549
+ return this.localBouts.find((n) => n.BoutId === this.selectedBout.BoutId) || this.selectedBout;
36550
+ },
36546
36551
  isMobile() {
36547
36552
  return this.windowWidth <= 748;
36548
36553
  },
@@ -36551,13 +36556,13 @@ const $m = /* @__PURE__ */ oe(tF, [["render", wF]]), yF = {
36551
36556
  return ((n = this.event) == null ? void 0 : n.EventRules) || {};
36552
36557
  },
36553
36558
  upcomingBouts() {
36554
- return this.bouts.filter((n) => n.Status === "Scheduled");
36559
+ return this.localBouts.filter((n) => n.Status === "Scheduled");
36555
36560
  },
36556
36561
  completedBouts() {
36557
- return this.bouts.filter((n) => n.Status === "Completed");
36562
+ return this.localBouts.filter((n) => n.Status === "Completed");
36558
36563
  },
36559
36564
  activeBouts() {
36560
- return this.bouts.filter((n) => n.Status === "Active");
36565
+ return this.localBouts.filter((n) => n.Status === "Active");
36561
36566
  },
36562
36567
  hasActiveBout() {
36563
36568
  return this.activeBouts.length > 0;
@@ -36579,7 +36584,7 @@ const $m = /* @__PURE__ */ oe(tF, [["render", wF]]), yF = {
36579
36584
  methods: {
36580
36585
  handleCloseModal(n) {
36581
36586
  if (this.showDirectorModal = !1, this.showEditBoutModal = !1, n.Status !== "Completed") {
36582
- const e = this.bouts.find((t) => t.BoutId === n.BoutId);
36587
+ const e = this.localBouts.find((t) => t.BoutId === n.BoutId);
36583
36588
  e && (e.Status = "Scheduled", e.Score1 = 0, e.Score2 = 0), this.$emit("update:bout", e);
36584
36589
  }
36585
36590
  },
@@ -36601,16 +36606,16 @@ const $m = /* @__PURE__ */ oe(tF, [["render", wF]]), yF = {
36601
36606
  },
36602
36607
  handleSubmitBout(n, e = !1) {
36603
36608
  this.showEditBoutModal = !1, this.showDirectorModal = !1;
36604
- const t = this.bouts.find((r) => r.BoutId === n.BoutId);
36609
+ const t = this.localBouts.find((r) => r.BoutId === n.BoutId);
36605
36610
  Object.assign(t, n), e || (t.Status = "Completed"), t.Ended = (/* @__PURE__ */ new Date()).toISOString(), this.$emit("submit:bout", t);
36606
36611
  },
36607
36612
  directBout(n) {
36608
- this.bouts.filter((r) => r.Status === "Active").forEach((r) => r.Status = "Scheduled");
36609
- const t = this.bouts.find((r) => r.BoutId === n.BoutId);
36613
+ this.localBouts.filter((r) => r.Status === "Active").forEach((r) => r.Status = "Scheduled");
36614
+ const t = this.localBouts.find((r) => r.BoutId === n.BoutId);
36610
36615
  t && (t.Status = "Active", this.showDirectorModal = !0, this.selectedBout = t), this.$emit("update:directing-bout", t);
36611
36616
  },
36612
36617
  editBout(n) {
36613
- this.bouts.find((t) => t.BoutId === n.BoutId) && (this.showEditBoutModal = !0, this.selectedBout = n);
36618
+ this.localBouts.find((t) => t.BoutId === n.BoutId) && (this.showEditBoutModal = !0, this.selectedBout = n);
36614
36619
  },
36615
36620
  handleResize() {
36616
36621
  this.windowWidth = window.innerWidth;
@@ -36650,7 +36655,7 @@ function HF(n, e, t, r, o, i) {
36650
36655
  class: "hidden md:block"
36651
36656
  }, null, 8, ["currentSelection", "onUpdate:selection", "connectedToServer"]),
36652
36657
  o.viewName === "Pool Grid" ? (f(), I("section", bF, [
36653
- h(l, { bouts: t.bouts }, null, 8, ["bouts"])
36658
+ h(l, { bouts: o.localBouts }, null, 8, ["bouts"])
36654
36659
  ])) : Q("", !0),
36655
36660
  m("section", null, [
36656
36661
  i.remainingBoutsCount > 0 ? (f(), I("section", xF, [
@@ -36754,7 +36759,7 @@ function HF(n, e, t, r, o, i) {
36754
36759
  ])) : Q("", !0)
36755
36760
  ]),
36756
36761
  h(d, {
36757
- bout: o.selectedBout,
36762
+ bout: i.currentSelectedBout,
36758
36763
  eventRules: i.eventRules,
36759
36764
  hostingClubColors: t.hostingClubColors,
36760
36765
  show: o.showDirectorModal,
@@ -36766,7 +36771,7 @@ function HF(n, e, t, r, o, i) {
36766
36771
  "onSubmit:bout": i.handleSubmitBout
36767
36772
  }, null, 8, ["bout", "eventRules", "hostingClubColors", "show", "onPenalty:add", "onPenalty:update", "onPenalty:remove", "onUpdate:closeModal", "onUpdate:bout", "onSubmit:bout"]),
36768
36773
  h(g, {
36769
- bout: o.selectedBout,
36774
+ bout: i.currentSelectedBout,
36770
36775
  eventRules: i.eventRules,
36771
36776
  hostingClubColors: t.hostingClubColors,
36772
36777
  show: o.showEditBoutModal,