Skip to content

Commit

Permalink
fix(offline indicator): change last online check from 30 to 60 minute…
Browse files Browse the repository at this point in the history
…s for a better estimate
  • Loading branch information
plebeius-eth committed Jun 22, 2024
1 parent a82f6f3 commit dbb91bf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/sidebar/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const Sidebar = ({ comment, isSubCreatedButNotYetPublished, settings, subplebbit
const { cid, downvoteCount, timestamp, upvoteCount } = comment || {};

const { allActiveUserCount, hourActiveUserCount } = useSubplebbitStats({ subplebbitAddress: address });
const isOnline = updatedAt && updatedAt > Date.now() / 1000 - 60 * 30;
const isOnline = updatedAt && updatedAt > Date.now() / 1000 - 60 * 60;
const onlineNotice = t('users_online', { count: hourActiveUserCount });
const offlineNotice = updatedAt && t('posts_last_synced', { dateAgo: getFormattedTimeAgo(updatedAt) });
const onlineStatus = isOnline ? onlineNotice : offlineNotice;
Expand Down
2 changes: 1 addition & 1 deletion src/views/subplebbit/subplebbit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const Subplebbit = () => {
</>
);

let isOnline = updatedAt && updatedAt > Date.now() / 1000 - 60 * 30;
let isOnline = updatedAt && updatedAt > Date.now() / 1000 - 60 * 60;
const isSubCreatedButNotYetPublished = typeof createdAt === 'number' && !updatedAt;

const { blocked } = useBlock({ address: subplebbitAddress });
Expand Down
2 changes: 1 addition & 1 deletion src/views/subplebbits/subplebbits.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const Subplebbit = ({ subplebbit }: SubplebbitProps) => {

const postScore = upvoteCount === 0 && downvoteCount === 0 ? '•' : upvoteCount - downvoteCount || '•';
const { allActiveUserCount } = useSubplebbitStats({ subplebbitAddress: address });
const isOnline = updatedAt && updatedAt > Date.now() / 1000 - 60 * 30;
const isOnline = updatedAt && updatedAt > Date.now() / 1000 - 60 * 60;

return (
<div className={styles.subplebbit}>
Expand Down

0 comments on commit dbb91bf

Please sign in to comment.