Remove reloadNav

This commit is contained in:
DianaXWiki 2026-05-04 11:14:30 +02:00
parent 13f149060a
commit 8c4f3bf345
3 changed files with 3 additions and 18 deletions

View File

@ -167,7 +167,6 @@ const _join: Callback = (ctx, clientId, data) => {
}
const isNew = typeof channels[channelId] === "undefined";
const isReloadNavigation = Boolean(data?.isReloadNavigation);
const isAnonymousSession = !store.loggedIn;
// Create or get existing channel object
@ -231,10 +230,7 @@ const _join: Callback = (ctx, clientId, data) => {
};
if (!isAnonymousSession) { return void allow(); }
if (!store.anon_rpc) {
if (isReloadNavigation && channel.wc) { return void allow(); }
return void (isReloadNavigation ? deny() : allow());
}
if (!store.anon_rpc) { return void allow(); }
_getMetadata(ctx, clientId, { channel: channelId }, md => {
if (md?.rejected) { return void deny(); }
allow();

View File

@ -19,21 +19,11 @@ define(['/common/common-util.js'], function (Util) {
var metadata= conf.metadata || {};
var versionHash = conf.versionHash;
var validateKey = metadata.validateKey;
var isReloadNavigation = false;
var onConnect = conf.onConnect || function () { };
var onError = conf.onError || function () { };
var onReady = conf.onReady || function () { };
var lastTime; // Time of last patch (if versioned link);
conf = undefined;
try {
var navEntry = window.performance && window.performance.getEntriesByType &&
window.performance.getEntriesByType('navigation')[0];
if (navEntry && navEntry.type) {
isReloadNavigation = navEntry.type === 'reload';
} else if (window.performance && window.performance.navigation) {
isReloadNavigation = window.performance.navigation.type === 1;
}
} catch (e) {}
if (versionHash) { readOnly = true; }
@ -154,8 +144,7 @@ define(['/common/common-util.js'], function (Util) {
channel: channel || null,
readOnly: readOnly,
versionHash: versionHash,
metadata: metadata,
isReloadNavigation: isReloadNavigation
metadata: metadata
});
};

File diff suppressed because one or more lines are too long