This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { mountShare, viewerURL } from './share.js?v=1';
|
||||
import { Camera } from './camera.js';
|
||||
const viewport = document.querySelector('#viewport');
|
||||
const state = document.querySelector('#state');
|
||||
@@ -87,7 +88,9 @@ async function start() {
|
||||
camera.x = camera.width/2-center.x*camera.scale; camera.y = camera.height/2-center.y*camera.scale; paint();
|
||||
}).observe(viewport);
|
||||
// Enforce configured expiry even when a viewer remains open.
|
||||
mountShare(document.querySelector('#viewer-share'),viewerURL(location.pathname,token));
|
||||
function expire() {
|
||||
if (result.expires_at === -1) return;
|
||||
const remaining = result.expires_at*1000-Date.now();
|
||||
if (remaining <= 0) { viewport.replaceChildren(); state.textContent = 'This schematic link has expired'; }
|
||||
else setTimeout(expire,Math.min(2147483647,remaining));
|
||||
|
||||
مرجع در شماره جدید
مسدود کردن کاربر