mirror of
https://github.com/ether/etherpad-lite.git
synced 2026-01-23 02:35:34 +00:00
chore: fixed recentPads being null
This commit is contained in:
parent
a9c91ac0d4
commit
4c9bce73ce
2 changed files with 10 additions and 10 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue