@pitcher/canvas-ui 2026.3.3-85006 → 2026.3.4-080723-beta
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.
package/canvas-ui.js
CHANGED
|
@@ -182051,7 +182051,15 @@ const HEARTBEAT_INTERVAL = 5e3;
|
|
|
182051
182051
|
const HEARTBEAT_THRESHOLD = 7e3;
|
|
182052
182052
|
const CHECK_INTERVAL = 1e3;
|
|
182053
182053
|
const isSomeTabFullscreen = ref(false);
|
|
182054
|
+
const hasLocalStorage = (() => {
|
|
182055
|
+
try {
|
|
182056
|
+
return typeof localStorage !== "undefined" && localStorage !== null;
|
|
182057
|
+
} catch {
|
|
182058
|
+
return false;
|
|
182059
|
+
}
|
|
182060
|
+
})();
|
|
182054
182061
|
function sendHeartbeat(fullscreen) {
|
|
182062
|
+
if (!hasLocalStorage) return;
|
|
182055
182063
|
const heartbeat = {
|
|
182056
182064
|
timestamp: Date.now(),
|
|
182057
182065
|
fullscreen
|
|
@@ -182059,9 +182067,11 @@ function sendHeartbeat(fullscreen) {
|
|
|
182059
182067
|
localStorage.setItem(HEARTBEAT_KEY, JSON.stringify(heartbeat));
|
|
182060
182068
|
}
|
|
182061
182069
|
function clearHeartbeat() {
|
|
182070
|
+
if (!hasLocalStorage) return;
|
|
182062
182071
|
localStorage.removeItem(HEARTBEAT_KEY);
|
|
182063
182072
|
}
|
|
182064
182073
|
function checkIfSomeTabIsFullscreen() {
|
|
182074
|
+
if (!hasLocalStorage) return;
|
|
182065
182075
|
const heartbeat = localStorage.getItem(HEARTBEAT_KEY);
|
|
182066
182076
|
if (heartbeat) {
|
|
182067
182077
|
const { timestamp, fullscreen } = JSON.parse(heartbeat);
|