chore: fixed recentPads being null

This commit is contained in:
SamTV12345 2025-08-12 21:44:28 +02:00
parent a9c91ac0d4
commit 4c9bce73ce
2 changed files with 10 additions and 10 deletions

View file

@ -70,13 +70,11 @@ exports.expressPreSession = async (hookName:string, {app}:ArgsExpressType) => {
}
console.log("Favicon is", settings.favicon)
const fns = [
...(settings.favicon ? [path.resolve(settings.root, settings.favicon)] : []),
settings.skinName && path.join(settings.root, 'src', 'static', 'skins', settings.skinName, 'favicon.ico'),
path.join(settings.root, 'src', 'static', 'favicon.ico'),
].filter(f=>f != null);
console.log('FNS are', fns)
for (const fn of fns) {
try {
await fsp.access(fn, fs.constants.R_OK);

View file

@ -489,15 +489,17 @@ const paduserlist = (() => {
online++;
}
}
const recentPadsList = JSON.parse(localStorage.getItem('recentPads'));
const pathSegments = window.location.pathname.split('/');
const padName = pathSegments[pathSegments.length - 1];
const existingPad = recentPadsList.find((pad) => pad.name === padName);
if (existingPad) {
existingPad.members = online;
}
localStorage.setItem('recentPads', JSON.stringify(recentPadsList));
if (localStorage.getItem('recentPads') != null) {
const recentPadsList = JSON.parse(localStorage.getItem('recentPads'));
const pathSegments = window.location.pathname.split('/');
const padName = pathSegments[pathSegments.length - 1];
const existingPad = recentPadsList.find((pad) => pad.name === padName);
if (existingPad) {
existingPad.members = online;
}
localStorage.setItem('recentPads', JSON.stringify(recentPadsList));
}
$('#online_count').text(online);