import { useEffect } from 'preact/hooks';
import { useSnapshot } from 'valtio';
import Columns from '../components/columns';
import Icon from '../components/icon';
import Link from '../components/link';
import db from '../utils/db';
import openCompose from '../utils/open-compose';
import states from '../utils/states';
import { getCurrentAccountNS } from '../utils/store-utils';
import Following from './following';
function Home() {
const snapStates = useSnapshot(states);
useEffect(() => {
(async () => {
const keys = await db.drafts.keys();
if (keys.length) {
const ns = getCurrentAccountNS();
const ownKeys = keys.filter((key) => key.startsWith(ns));
if (ownKeys.length) {
states.showDrafts = true;
}
}
})();
}, []);
return (
<>
{snapStates.settings.shortcutsColumnsMode &&
!!snapStates.shortcuts?.length ? (
) : (
{
e.stopPropagation();
}}
>
}
/>
)}
>
);
}
export default Home;