@designcrowd/library.brand-page 5.16.4-kp-bug-1 → 5.16.4

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.
Files changed (20) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-B5n_ZeCt.js → CreatedOnBrandCrowd-de-de-BSBOfb8b.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-BPC9utbT.js → CreatedOnBrandCrowd-en-us--TNEsX53.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-B0UZmrEA.js → CreatedOnBrandCrowd-es-es-CiW0V1s6.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-Oan2SoEc.js → CreatedOnBrandCrowd-fr-ca-CLUg9MpZ.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-Oan2SoEc.js → CreatedOnBrandCrowd-fr-fr-CLUg9MpZ.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-Df7qPjXl.js → CreatedOnBrandCrowd-pt-br-RcuVcV12.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-Df7qPjXl.js → CreatedOnBrandCrowd-pt-pt-RcuVcV12.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-BWA04oAF.js → CreatedOnDcom-de-de-CxEV99br.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-DfIUGOpr.js → CreatedOnDcom-en-us-CjwaOUG0.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-DwOPY9Dl.js → CreatedOnDcom-es-es-BKcWjmjk.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-KD72r7sn.js → CreatedOnDcom-fr-ca-CgNSYXVe.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-DnpMBBXv.js → CreatedOnDcom-fr-fr-DcCwRFeB.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-DjIUtstu.js → CreatedOnDcom-pt-br-D1vS1gRg.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-z1SrKP_n.js → CreatedOnDcom-pt-pt-BgEElCPj.js} +1 -1
  15. package/lib/src/index.mjs +1 -1
  16. package/lib/src/{lib-CfRoAJek.js → lib-BUOXEI8B.js} +6 -10
  17. package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.d.ts +4 -1
  18. package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.js +5 -18
  19. package/package.json +1 -1
  20. package/src/shared/template-settings/components/TemplatesSettings.mixin.ts +8 -23
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-CfRoAJek.js";
2
+ import { _ as t } from "./lib-BUOXEI8B.js";
3
3
  const i = {}, h = {
4
4
  width: "275",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-CfRoAJek.js";
2
+ import { _ as t } from "./lib-BUOXEI8B.js";
3
3
  const i = {}, h = {
4
4
  width: "251",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-CfRoAJek.js";
2
+ import { _ as t } from "./lib-BUOXEI8B.js";
3
3
  const i = {}, h = {
4
4
  width: "250",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-CfRoAJek.js";
2
+ import { _ as t } from "./lib-BUOXEI8B.js";
3
3
  const i = {}, h = {
4
4
  width: "237",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-CfRoAJek.js";
2
+ import { _ as t } from "./lib-BUOXEI8B.js";
3
3
  const i = {}, h = {
4
4
  width: "237",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-CfRoAJek.js";
2
+ import { _ as t } from "./lib-BUOXEI8B.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-CfRoAJek.js";
2
+ import { _ as t } from "./lib-BUOXEI8B.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-CfRoAJek.js";
2
+ import { _ as e } from "./lib-BUOXEI8B.js";
3
3
  const M = {}, Z = {
4
4
  width: "242",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-CfRoAJek.js";
2
+ import { _ as e } from "./lib-BUOXEI8B.js";
3
3
  const i = {}, M = {
4
4
  width: "231",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-CfRoAJek.js";
2
+ import { _ as e } from "./lib-BUOXEI8B.js";
3
3
  const M = {}, Z = {
4
4
  width: "230",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-CfRoAJek.js";
2
+ import { _ as e } from "./lib-BUOXEI8B.js";
3
3
  const i = {}, l = {
4
4
  width: "216",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-CfRoAJek.js";
2
+ import { _ as e } from "./lib-BUOXEI8B.js";
3
3
  const i = {}, l = {
4
4
  width: "216",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as M } from "./lib-CfRoAJek.js";
2
+ import { _ as M } from "./lib-BUOXEI8B.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as M } from "./lib-CfRoAJek.js";
2
+ import { _ as M } from "./lib-BUOXEI8B.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
package/lib/src/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { bD as E, ar as T, aU as I, a5 as s, aj as N, ai as S, af as A, bt as e, bK as O, cb as G, ca as C, c9 as D, c3 as P, b2 as t, b1 as R, bP as L, bQ as M, bX as o, bM as b, bO as r, bN as F, bR as n, bS as B, c2 as i, c0 as l, aq as g, c1 as Y, a8 as U, aZ as c, a$ as d, a_ as u, e as H, f as y, B as p, $ as K, d as V, a0 as k, j as X, an as m, Z as v, bs as h, bL as W, ay as x, aW as f, aS as z, b_ as Z, bZ as w, C as Q, b5 as j, D as q, b as J, a as $, bV as aa, b4 as _a, aX as Ea, aT as Ta, c7 as Ia, c8 as sa, bY as Na, bH as Sa, ad as Aa, b$ as ea, c4 as Oa, ba as Ga, aK as Ca, bg as Da, F as Pa, a7 as ta, a6 as Ra, h as La, a1 as Ma, b7 as oa, aV as ba, aR as ra, a3 as Fa, ak as na, l as Ba, K as ia, H as la, a9 as ga, bE as Ya, bb as Ua, bc as ca, bC as da, bi as ua, bk as Ha, b6 as ya, L as pa, aJ as Ka, bp as Va, aP as ka, bo as Xa, as as ma, ab as va, bW as ha, c5 as Wa, c6 as xa, aY as fa, N as za, aB as Za, aA as wa, aC as Qa, aw as ja, ax as qa, az as Ja, be as $a, bl as a_, b8 as __, o as E_, al as T_, am as I_, ag as s_, ah as N_, ae as S_, a4 as A_, m as e_, bq as O_, ap as G_, bI as C_, bJ as D_, bU as P_, ac as t_, bG as R_, br as L_, n as M_, S as o_, P as b_, aI as r_, bF as F_, bf as n_, bx as B_, bw as i_, bz as l_, bu as g_, bA as Y_, bB as U_, bv as c_, by as d_, aD as u_, aE as H_, bn as y_, bm as p_, aG as K_, aH as V_, aM as k_, b0 as X_, aL as m_, aN as v_, U as h_, aa as W_, aQ as x_, k as f_, bd as z_, ao as Z_, b9 as w_, bh as Q_, bj as j_, b3 as q_, Q as J_, a2 as $_, g as aE, bT as _E, r as EE, u as TE, M as IE, Y as sE, aF as NE, aO as SE, au as AE, p as eE, W as OE, t as GE, w as CE, at as DE, i as PE, av as tE, c as RE, q as LE, v as ME, V as oE, O as bE, s as rE, X as FE, A as nE, x as BE, y as iE, T as lE, E as gE, R as YE, G as UE, J as cE, z as dE, I as uE } from "./lib-CfRoAJek.js";
1
+ import { bD as E, ar as T, aU as I, a5 as s, aj as N, ai as S, af as A, bt as e, bK as O, cb as G, ca as C, c9 as D, c3 as P, b2 as t, b1 as R, bP as L, bQ as M, bX as o, bM as b, bO as r, bN as F, bR as n, bS as B, c2 as i, c0 as l, aq as g, c1 as Y, a8 as U, aZ as c, a$ as d, a_ as u, e as H, f as y, B as p, $ as K, d as V, a0 as k, j as X, an as m, Z as v, bs as h, bL as W, ay as x, aW as f, aS as z, b_ as Z, bZ as w, C as Q, b5 as j, D as q, b as J, a as $, bV as aa, b4 as _a, aX as Ea, aT as Ta, c7 as Ia, c8 as sa, bY as Na, bH as Sa, ad as Aa, b$ as ea, c4 as Oa, ba as Ga, aK as Ca, bg as Da, F as Pa, a7 as ta, a6 as Ra, h as La, a1 as Ma, b7 as oa, aV as ba, aR as ra, a3 as Fa, ak as na, l as Ba, K as ia, H as la, a9 as ga, bE as Ya, bb as Ua, bc as ca, bC as da, bi as ua, bk as Ha, b6 as ya, L as pa, aJ as Ka, bp as Va, aP as ka, bo as Xa, as as ma, ab as va, bW as ha, c5 as Wa, c6 as xa, aY as fa, N as za, aB as Za, aA as wa, aC as Qa, aw as ja, ax as qa, az as Ja, be as $a, bl as a_, b8 as __, o as E_, al as T_, am as I_, ag as s_, ah as N_, ae as S_, a4 as A_, m as e_, bq as O_, ap as G_, bI as C_, bJ as D_, bU as P_, ac as t_, bG as R_, br as L_, n as M_, S as o_, P as b_, aI as r_, bF as F_, bf as n_, bx as B_, bw as i_, bz as l_, bu as g_, bA as Y_, bB as U_, bv as c_, by as d_, aD as u_, aE as H_, bn as y_, bm as p_, aG as K_, aH as V_, aM as k_, b0 as X_, aL as m_, aN as v_, U as h_, aa as W_, aQ as x_, k as f_, bd as z_, ao as Z_, b9 as w_, bh as Q_, bj as j_, b3 as q_, Q as J_, a2 as $_, g as aE, bT as _E, r as EE, u as TE, M as IE, Y as sE, aF as NE, aO as SE, au as AE, p as eE, W as OE, t as GE, w as CE, at as DE, i as PE, av as tE, c as RE, q as LE, v as ME, V as oE, O as bE, s as rE, X as FE, A as nE, x as BE, y as iE, T as lE, E as gE, R as YE, G as UE, J as cE, z as dE, I as uE } from "./lib-BUOXEI8B.js";
2
2
  import { createPinia as yE, setActivePinia as pE } from "pinia";
3
3
  export {
4
4
  E as ABOUT_SECTION_SETTINGS_CONFIG,
@@ -58027,10 +58027,10 @@ const on = /* @__PURE__ */ j6(vT1), ST1 = (e, t, n) => {
58027
58027
  ut(() => n.context.isDesignCom, async () => {
58028
58028
  const S = x8().toLowerCase(), k = n.context.isDesignCom ? "Dcom" : "BrandCrowd";
58029
58029
  try {
58030
- const { default: M } = await K_(/* @__PURE__ */ Object.assign({ "./watermark/CreatedOnBrandCrowd-de-de.vue": () => import("./CreatedOnBrandCrowd-de-de-B5n_ZeCt.js"), "./watermark/CreatedOnBrandCrowd-en-us.vue": () => import("./CreatedOnBrandCrowd-en-us-BPC9utbT.js"), "./watermark/CreatedOnBrandCrowd-es-es.vue": () => import("./CreatedOnBrandCrowd-es-es-B0UZmrEA.js"), "./watermark/CreatedOnBrandCrowd-fr-ca.vue": () => import("./CreatedOnBrandCrowd-fr-ca-Oan2SoEc.js"), "./watermark/CreatedOnBrandCrowd-fr-fr.vue": () => import("./CreatedOnBrandCrowd-fr-fr-Oan2SoEc.js"), "./watermark/CreatedOnBrandCrowd-pt-br.vue": () => import("./CreatedOnBrandCrowd-pt-br-Df7qPjXl.js"), "./watermark/CreatedOnBrandCrowd-pt-pt.vue": () => import("./CreatedOnBrandCrowd-pt-pt-Df7qPjXl.js"), "./watermark/CreatedOnDcom-de-de.vue": () => import("./CreatedOnDcom-de-de-BWA04oAF.js"), "./watermark/CreatedOnDcom-en-us.vue": () => import("./CreatedOnDcom-en-us-DfIUGOpr.js"), "./watermark/CreatedOnDcom-es-es.vue": () => import("./CreatedOnDcom-es-es-DwOPY9Dl.js"), "./watermark/CreatedOnDcom-fr-ca.vue": () => import("./CreatedOnDcom-fr-ca-KD72r7sn.js"), "./watermark/CreatedOnDcom-fr-fr.vue": () => import("./CreatedOnDcom-fr-fr-DnpMBBXv.js"), "./watermark/CreatedOnDcom-pt-br.vue": () => import("./CreatedOnDcom-pt-br-DjIUtstu.js"), "./watermark/CreatedOnDcom-pt-pt.vue": () => import("./CreatedOnDcom-pt-pt-z1SrKP_n.js") }), `./watermark/CreatedOn${k}-${S}.vue`, 3);
58030
+ const { default: M } = await K_(/* @__PURE__ */ Object.assign({ "./watermark/CreatedOnBrandCrowd-de-de.vue": () => import("./CreatedOnBrandCrowd-de-de-BSBOfb8b.js"), "./watermark/CreatedOnBrandCrowd-en-us.vue": () => import("./CreatedOnBrandCrowd-en-us--TNEsX53.js"), "./watermark/CreatedOnBrandCrowd-es-es.vue": () => import("./CreatedOnBrandCrowd-es-es-CiW0V1s6.js"), "./watermark/CreatedOnBrandCrowd-fr-ca.vue": () => import("./CreatedOnBrandCrowd-fr-ca-CLUg9MpZ.js"), "./watermark/CreatedOnBrandCrowd-fr-fr.vue": () => import("./CreatedOnBrandCrowd-fr-fr-CLUg9MpZ.js"), "./watermark/CreatedOnBrandCrowd-pt-br.vue": () => import("./CreatedOnBrandCrowd-pt-br-RcuVcV12.js"), "./watermark/CreatedOnBrandCrowd-pt-pt.vue": () => import("./CreatedOnBrandCrowd-pt-pt-RcuVcV12.js"), "./watermark/CreatedOnDcom-de-de.vue": () => import("./CreatedOnDcom-de-de-CxEV99br.js"), "./watermark/CreatedOnDcom-en-us.vue": () => import("./CreatedOnDcom-en-us-CjwaOUG0.js"), "./watermark/CreatedOnDcom-es-es.vue": () => import("./CreatedOnDcom-es-es-BKcWjmjk.js"), "./watermark/CreatedOnDcom-fr-ca.vue": () => import("./CreatedOnDcom-fr-ca-CgNSYXVe.js"), "./watermark/CreatedOnDcom-fr-fr.vue": () => import("./CreatedOnDcom-fr-fr-DcCwRFeB.js"), "./watermark/CreatedOnDcom-pt-br.vue": () => import("./CreatedOnDcom-pt-br-D1vS1gRg.js"), "./watermark/CreatedOnDcom-pt-pt.vue": () => import("./CreatedOnDcom-pt-pt-BgEElCPj.js") }), `./watermark/CreatedOn${k}-${S}.vue`, 3);
58031
58031
  i.value = M;
58032
58032
  } catch {
58033
- const { default: H } = await K_(/* @__PURE__ */ Object.assign({ "./watermark/CreatedOnBrandCrowd-en-us.vue": () => import("./CreatedOnBrandCrowd-en-us-BPC9utbT.js"), "./watermark/CreatedOnDcom-en-us.vue": () => import("./CreatedOnDcom-en-us-DfIUGOpr.js") }), `./watermark/CreatedOn${k}-en-us.vue`, 3);
58033
+ const { default: H } = await K_(/* @__PURE__ */ Object.assign({ "./watermark/CreatedOnBrandCrowd-en-us.vue": () => import("./CreatedOnBrandCrowd-en-us--TNEsX53.js"), "./watermark/CreatedOnDcom-en-us.vue": () => import("./CreatedOnDcom-en-us-CjwaOUG0.js") }), `./watermark/CreatedOn${k}-en-us.vue`, 3);
58034
58034
  i.value = H;
58035
58035
  }
58036
58036
  }, {
@@ -97065,7 +97065,7 @@ const eae = 100, Uk = J({
97065
97065
  tabs: e.map((t) => t.displayName),
97066
97066
  debounceOnSearch: void 0,
97067
97067
  searchTextValue: "",
97068
- prevTemplateTab: "",
97068
+ prevTemplateTab: e[0],
97069
97069
  tabsWithTranslations: e
97070
97070
  };
97071
97071
  },
@@ -97139,15 +97139,11 @@ const eae = 100, Uk = J({
97139
97139
  }), this.eventTracker.sendTemplateCategorySelectEvent(e.name);
97140
97140
  },
97141
97141
  async selectTab(e) {
97142
- var o;
97143
97142
  await this.templateSettingsStore.onTabSelected({ tabName: e });
97144
- let t = this.tabsWithTranslations.find(
97145
- (r) => r.displayName === e
97143
+ const t = this.tabsWithTranslations.find(
97144
+ (n) => n.displayName === e
97146
97145
  );
97147
- t || (t = this.tabsWithTranslations[0], console.warn(`Tab "${e}" not found, defaulting to first tab.`));
97148
- const n = ((o = this.prevTemplateTab) == null ? void 0 : o.key) ?? null, i = t.key;
97149
- debugger;
97150
- i !== lg.categories && n !== i && (this.templateSettingsStore.clearTemplates(), await this.templateSettingsStore.gotoNextPage()), this.prevTemplateTab = t;
97146
+ t.key !== lg.categories && this.prevTemplateTab.key !== t.key && (this.templateSettingsStore.clearTemplates(), await this.templateSettingsStore.gotoNextPage(), this.prevTemplateTab = t);
97151
97147
  },
97152
97148
  async setSearchText() {
97153
97149
  await this.templateSettingsStore.onSearch({
@@ -585,7 +585,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
585
585
  tabs: string[];
586
586
  debounceOnSearch: DebounceHandle | undefined;
587
587
  searchTextValue: string;
588
- prevTemplateTab: string;
588
+ prevTemplateTab: {
589
+ key: string;
590
+ displayName: string;
591
+ };
589
592
  tabsWithTranslations: {
590
593
  key: string;
591
594
  displayName: string;
@@ -43,7 +43,7 @@ export default defineComponent({
43
43
  tabs: tabsWithTranslations.map((tab) => tab.displayName),
44
44
  debounceOnSearch: undefined,
45
45
  searchTextValue: '',
46
- prevTemplateTab: '',
46
+ prevTemplateTab: tabsWithTranslations[0],
47
47
  tabsWithTranslations,
48
48
  };
49
49
  },
@@ -143,26 +143,13 @@ export default defineComponent({
143
143
  },
144
144
  async selectTab(tabName) {
145
145
  await this.templateSettingsStore.onTabSelected({ tabName });
146
- // Find the tab by displayName, fallback to first tab if not found
147
- let selectedTab = this.tabsWithTranslations.find((tab) => tab.displayName === tabName);
148
- if (!selectedTab) {
149
- // Fallback for mobile or translation issues
150
- selectedTab = this.tabsWithTranslations[0];
151
- console.warn(`Tab "${tabName}" not found, defaulting to first tab.`);
152
- }
153
- // Defensive: ensure prevTemplateTab is always defined
154
- const prevTabKey = this.prevTemplateTab?.key ?? null;
155
- const selectedTabKey = selectedTab.key;
156
- debugger;
157
- // Only clear and reload if switching away from categories and tab actually changed
158
- const shouldClearAndReload = selectedTabKey !== TEMPLATE_TABS.categories &&
159
- prevTabKey !== selectedTabKey;
160
- if (shouldClearAndReload) {
146
+ const selectedTab = this.tabsWithTranslations.find((tab) => tab.displayName === tabName);
147
+ if (selectedTab.key !== TEMPLATE_TABS.categories &&
148
+ this.prevTemplateTab.key !== selectedTab.key) {
161
149
  this.templateSettingsStore.clearTemplates();
162
150
  await this.templateSettingsStore.gotoNextPage();
151
+ this.prevTemplateTab = selectedTab;
163
152
  }
164
- // Always update prevTemplateTab for reactivity
165
- this.prevTemplateTab = selectedTab;
166
153
  },
167
154
  async setSearchText() {
168
155
  await this.templateSettingsStore.onSearch({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@designcrowd/library.brand-page",
3
3
  "description": "A collection of Maker/Designer applications",
4
- "version": "5.16.4-kp-bug-1",
4
+ "version": "5.16.4",
5
5
  "author": "Design.com Eng",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",
@@ -65,7 +65,7 @@ export default defineComponent({
65
65
  tabs: tabsWithTranslations.map((tab) => tab.displayName),
66
66
  debounceOnSearch: undefined as DebounceHandle | undefined,
67
67
  searchTextValue: '',
68
- prevTemplateTab: '',
68
+ prevTemplateTab: tabsWithTranslations[0],
69
69
  tabsWithTranslations,
70
70
  };
71
71
  },
@@ -199,34 +199,19 @@ export default defineComponent({
199
199
  async selectTab(tabName: TemplateTab) {
200
200
  await this.templateSettingsStore.onTabSelected({ tabName });
201
201
 
202
- // Find the tab by displayName, fallback to first tab if not found
203
- let selectedTab = this.tabsWithTranslations.find(
202
+ const selectedTab = this.tabsWithTranslations.find(
204
203
  (tab) => tab.displayName === tabName,
205
204
  );
206
205
 
207
- if (!selectedTab) {
208
- // Fallback for mobile or translation issues
209
- selectedTab = this.tabsWithTranslations[0];
210
- console.warn(`Tab "${tabName}" not found, defaulting to first tab.`);
211
- }
212
-
213
- // Defensive: ensure prevTemplateTab is always defined
214
- const prevTabKey = this.prevTemplateTab?.key ?? null;
215
- const selectedTabKey = selectedTab.key;
216
-
217
- debugger;
218
- // Only clear and reload if switching away from categories and tab actually changed
219
- const shouldClearAndReload =
220
- selectedTabKey !== TEMPLATE_TABS.categories &&
221
- prevTabKey !== selectedTabKey;
222
-
223
- if (shouldClearAndReload) {
206
+ if (
207
+ selectedTab.key !== TEMPLATE_TABS.categories &&
208
+ this.prevTemplateTab.key !== selectedTab.key
209
+ ) {
224
210
  this.templateSettingsStore.clearTemplates();
225
211
  await this.templateSettingsStore.gotoNextPage();
226
- }
227
212
 
228
- // Always update prevTemplateTab for reactivity
229
- this.prevTemplateTab = selectedTab;
213
+ this.prevTemplateTab = selectedTab;
214
+ }
230
215
  },
231
216
 
232
217
  async setSearchText() {