nice clean recipes pear.dunkirk.sh
recipes
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: scope to proper url

+8 -3
+8 -3
ui/templates/recipe.html
··· 82 82 document.querySelectorAll('.ingredient-list li').forEach(li => { 83 83 state[li.id] = li.classList.contains('checked'); 84 84 }); 85 - localStorage.setItem(location.pathname, JSON.stringify(state)); 85 + localStorage.setItem('pare:' + new URL(location.href).searchParams.get('url'), JSON.stringify({t: Date.now(), s: state})); 86 86 } 87 87 88 88 function loadChecks() { 89 89 try { 90 - const state = JSON.parse(localStorage.getItem(location.pathname) || '{}'); 91 - Object.entries(state).forEach(([id, checked]) => { 90 + const raw = JSON.parse(localStorage.getItem('pare:' + new URL(location.href).searchParams.get('url')) || 'null'); 91 + if (!raw) return; 92 + if (Date.now() - raw.t > 48 * 60 * 60 * 1000) { 93 + localStorage.removeItem('pare:' + new URL(location.href).searchParams.get('url')); 94 + return; 95 + } 96 + Object.entries(raw.s).forEach(([id, checked]) => { 92 97 const li = document.getElementById(id); 93 98 if (li && checked) { 94 99 li.classList.add('checked');