This commit is contained in:
Max Lynch
2021-01-05 16:32:10 -06:00
parent c4fc3367ba
commit 6a14c1c47a
4 changed files with 1 additions and 14 deletions
-6
View File
@@ -4,12 +4,6 @@ import { Link } from 'wouter';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
const Tab = ({ title, href, icon, selected, selectedIcon, onClick }) => { const Tab = ({ title, href, icon, selected, selectedIcon, onClick }) => {
console.log('TAB', href, selected);
const [update, setUpdate] = useState(false);
useEffect(() => {
setUpdate(true);
}, [selected]);
return ( return (
<Link href={href}> <Link href={href}>
<a <a
-1
View File
@@ -51,7 +51,6 @@ const useLocation = ({ base = '' } = {}) => {
// that's why we store the last pathname in a ref. // that's why we store the last pathname in a ref.
const checkForUpdates = () => { const checkForUpdates = () => {
const pathname = getCurrentPathname(base); const pathname = getCurrentPathname(base);
console.log('CHECK FOR UPDATES', pathname);
prevPath.current !== pathname && update((prevPath.current = pathname)); prevPath.current !== pathname && update((prevPath.current = pathname));
}; };
+1
View File
@@ -3,6 +3,7 @@ import Store from '../store';
const usePage = fields => { const usePage = fields => {
useEffect(() => { useEffect(() => {
console.log('Use page effect');
Store.update(s => { Store.update(s => {
s.currentPage = fields; s.currentPage = fields;
}); });
-7
View File
@@ -23,7 +23,6 @@ export const setSettings = settings => {
export const setDone = (list, item, done) => { export const setDone = (list, item, done) => {
Store.update((s, o) => { Store.update((s, o) => {
const listIndex = o.lists.findIndex(l => l === list); const listIndex = o.lists.findIndex(l => l === list);
console.log('Setting done', list, item, done, o.lists, listIndex);
const itemIndex = o.lists[listIndex].items.findIndex(i => i === item); const itemIndex = o.lists[listIndex].items.findIndex(i => i === item);
s.lists[listIndex].items[itemIndex].done = done; s.lists[listIndex].items[itemIndex].done = done;
if (list === o.selectedList) { if (list === o.selectedList) {
@@ -31,9 +30,3 @@ export const setDone = (list, item, done) => {
} }
}); });
}; };
export const setSelectedList = list => {
Store.update(s => {
s.selectedList = list;
});
};