Merge pull request #308 from cheeaun/main

Update from main
This commit is contained in:
Chee Aun 2023-11-07 00:52:17 +08:00 committed by GitHub
commit a75b214999
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 14 deletions

View file

@ -466,15 +466,6 @@ const fetchLists = pmem(
maxAge: FETCH_MAX_AGE,
},
);
const fetchFollowedHashtags = pmem(
() => {
const { masto } = api();
return masto.v1.followedTags.list();
},
{
maxAge: FETCH_MAX_AGE,
},
);
function ShortcutForm({
onSubmit,
@ -486,6 +477,7 @@ function ShortcutForm({
console.log('shortcut', shortcut);
const editMode = !!shortcut;
const [currentType, setCurrentType] = useState(shortcut?.type || null);
const { masto } = api();
const [uiState, setUIState] = useState('default');
const [lists, setLists] = useState([]);
@ -508,7 +500,7 @@ function ShortcutForm({
(async () => {
if (currentType !== 'hashtag') return;
try {
const iterator = fetchFollowedHashtags();
const iterator = masto.v1.followedTags.list();
const tags = [];
do {
const { value, done } = await iterator.next();

View file

@ -101,7 +101,7 @@ function Shortcuts() {
{formattedShortcuts.map(
({ id, path, title, subtitle, icon }, i) => {
return (
<li key={i + title}>
<li key={`${i}-${id}-${title}-${subtitle}-${path}`}>
<Link
class={subtitle ? 'has-subtitle' : ''}
to={path}
@ -170,9 +170,13 @@ function Shortcuts() {
</button>
}
>
{formattedShortcuts.map(({ path, title, subtitle, icon }, i) => {
{formattedShortcuts.map(({ id, path, title, subtitle, icon }, i) => {
return (
<MenuLink to={path} key={i + title} class="glass-menu-item">
<MenuLink
to={path}
key={`${i}-${id}-${title}-${subtitle}-${path}`}
class="glass-menu-item"
>
<Icon icon={icon} size="l" />{' '}
<span class="menu-grow">
<span>

View file

@ -216,7 +216,8 @@ function Notifications({ columnMode }) {
let unsub;
if (visible) {
const timeDiff = Date.now() - lastHiddenTime.current;
if (!lastHiddenTime.current || timeDiff > 1000 * 60) {
if (!lastHiddenTime.current || timeDiff > 1000 * 3) {
// 3 seconds
loadUpdates({
disableIdleCheck: true,
});