@antelopejs/dms 0.20.8-next.947.gfffa17c → 0.20.8-next.948.ga4e346d

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.
@@ -221,6 +221,7 @@ function arriveTableViews(context: ReturnType<typeof createTableViewState>) {
221
221
  let isUrlViewUnavailable = false;
222
222
  let isUrlViewPending = false;
223
223
  let isOpenedOnArrival = false;
224
+ let isDefaultViewOpenedOnFirstVisit = false;
224
225
  if (urlView.isCleared) {
225
226
  openDefaultListing();
226
227
  } else if (urlView.value && findView(urlView.value)) {
@@ -231,6 +232,7 @@ function arriveTableViews(context: ReturnType<typeof createTableViewState>) {
231
232
  } else if (persistedViewId === undefined) {
232
233
  if (views?.defaultView) openView(views.defaultView);
233
234
  isOpenedOnArrival = !!views?.defaultView;
235
+ isDefaultViewOpenedOnFirstVisit = isOpenedOnArrival;
234
236
  } else {
235
237
  restoreKeptView(persistedViewId);
236
238
  }
@@ -252,8 +254,16 @@ function arriveTableViews(context: ReturnType<typeof createTableViewState>) {
252
254
  }
253
255
  };
254
256
 
257
+ const keepActiveView = () =>
258
+ preferences.set<string | undefined>(
259
+ "activeView",
260
+ keptViewId(activeViewId.value),
261
+ undefined,
262
+ );
263
+
255
264
  onMounted(() => {
256
265
  arriveOnceMounted();
266
+ if (isDefaultViewOpenedOnFirstVisit) keepActiveView();
257
267
  if (urlView.ignoredShortKey && import.meta.env.DEV) {
258
268
  console.warn(
259
269
  `[DMS] "?${VIEW_URL_KEY}=" is ignored on a page with several table views: name the table, "?${urlScope.tableId}.${VIEW_URL_KEY}=".`,
@@ -268,13 +278,7 @@ function arriveTableViews(context: ReturnType<typeof createTableViewState>) {
268
278
  });
269
279
  });
270
280
 
271
- watch(activeViewId, (id) => {
272
- preferences.set<string | undefined>(
273
- "activeView",
274
- keptViewId(id),
275
- undefined,
276
- );
277
- });
281
+ watch(activeViewId, keepActiveView);
278
282
 
279
283
  const change = computed<TableViewChange>(() => {
280
284
  const view = activeView.value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antelopejs/dms",
3
- "version": "0.20.8-next.947.gfffa17c",
3
+ "version": "0.20.8-next.948.ga4e346d",
4
4
  "description": "AntelopeJS DMS. Plug in your PostgreSQL, MySQL, MariaDB, MongoDB or RethinkDB database and your coding agent builds a back office and analytics dashboard as typed TypeScript. Real-time updates on the data the DMS manages.",
5
5
  "keywords": [
6
6
  "antelopejs",
@@ -209,7 +209,7 @@
209
209
  "optional": true
210
210
  }
211
211
  },
212
- "gitHead": "fffa17c94cb121c61171cfc6d47d1f24058fdf6c",
212
+ "gitHead": "a4e346d6f5cc151a8c030a14763493815343a02a",
213
213
  "scripts": {
214
214
  "build": "pnpm --filter @antelopejs/interface-dms --filter @antelopejs/interface-dms-builder build && rimraf dist && tsc && tsc-alias && tsc -p bin/tsconfig.types.json",
215
215
  "dev": "ajs project run --inspect -w -p playground",