@camera.ui/browser 0.0.197 → 0.0.199

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 (2) hide show
  1. package/dist/index.js +9 -6
  2. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -552,14 +552,16 @@ function useSnapshot(cameraIdOrName) {
552
552
  heldDeviceId = void 0;
553
553
  }
554
554
  }
555
+ function showCached(id) {
556
+ const cached = snapshotCache.get(id);
557
+ if (!cached) return false;
558
+ snapshot.value = cached;
559
+ initialLoadDone.value = true;
560
+ return true;
561
+ }
555
562
  async function loadSnapshot(id, skipCache = false) {
556
563
  if (!isConnected.value || !id) return;
557
- const cached = skipCache ? void 0 : snapshotCache.get(id);
558
- if (cached) {
559
- snapshot.value = cached;
560
- initialLoadDone.value = true;
561
- return;
562
- }
564
+ if (!skipCache && showCached(id)) return;
563
565
  _isLoading.value = true;
564
566
  try {
565
567
  const result = await fetchSnapshotShared(deviceManager, id);
@@ -596,6 +598,7 @@ function useSnapshot(cameraIdOrName) {
596
598
  const id = typeof cameraIdName === "string" ? cameraIdName : cameraIdName._id;
597
599
  if (connected && id && !disabled) {
598
600
  unsubscribe = subscribe(id);
601
+ showCached(id);
599
602
  await holdDevice(id);
600
603
  await loadSnapshot(id);
601
604
  } else if (id) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camera.ui/browser",
3
- "version": "0.0.197",
3
+ "version": "0.0.199",
4
4
  "description": "camera.ui browser client",
5
5
  "author": "seydx (https://github.com/cameraui/clients)",
6
6
  "type": "module",
@@ -39,13 +39,13 @@
39
39
  "devDependencies": {
40
40
  "@camera.ui/logger": "file:../../packages/logger",
41
41
  "@camera.ui/rpc": "^1.0.12",
42
- "@camera.ui/sdk": "~1.3.2",
42
+ "@camera.ui/sdk": "~1.3.3",
43
43
  "@camera.ui/transport": "file:../../packages/transport",
44
- "@eneris/push-receiver": "^4.3.1",
45
- "@microsoft/api-extractor": "^7.59.1",
44
+ "@eneris/push-receiver": "^4.4.0",
45
+ "@microsoft/api-extractor": "^7.59.2",
46
46
  "@stylistic/eslint-plugin": "^5.10.0",
47
47
  "@types/webrtc": "^0.0.47",
48
- "@typescript-eslint/parser": "^8.70.0",
48
+ "@typescript-eslint/parser": "^8.70.1",
49
49
  "@vitejs/plugin-vue": "^6.0.9",
50
50
  "@vue/eslint-config-prettier": "^10.2.0",
51
51
  "@vue/eslint-config-typescript": "^14.9.0",
@@ -54,14 +54,14 @@
54
54
  "@vueuse/core": "^15.0.0",
55
55
  "@webgpu/types": "^0.1.74",
56
56
  "eslint": "9.39.2",
57
- "eslint-plugin-vue": "^10.11.0",
57
+ "eslint-plugin-vue": "^10.11.1",
58
58
  "globals": "^17.12.0",
59
- "prettier": "^3.9.8",
59
+ "prettier": "^3.9.9",
60
60
  "rimraf": "^6.1.3",
61
61
  "typescript": "5.9.3",
62
- "typescript-eslint": "^8.70.0",
62
+ "typescript-eslint": "^8.70.1",
63
63
  "unplugin-dts": "^1.1.1",
64
- "updates": "^18.1.1",
64
+ "updates": "^19.0.0",
65
65
  "vite": "^8.3.0",
66
66
  "vitest": "^5.0.1",
67
67
  "vue": "^3.5.43",