Should not check updates in cloud mode. Minor updates.

This commit is contained in:
Mike Cao 2023-07-28 22:28:06 -07:00
parent 8062d7f698
commit 56ab099499
4 changed files with 10 additions and 9 deletions

View File

@ -13,7 +13,11 @@ export function UpdateNotice({ user, config }) {
const { pathname } = useRouter();
const [dismissed, setDismissed] = useState(checked);
const allowUpdate =
user?.isAdmin && !config?.updatesDisabled && !pathname.includes('/share/') && !dismissed;
user?.isAdmin &&
!config?.updatesDisabled &&
!config?.cloudMode &&
!pathname.includes('/share/') &&
!dismissed;
const updateCheck = useCallback(() => {
setItem(VERSION_CHECK, { version: latest, time: Date.now() });

View File

@ -3,7 +3,7 @@ import BarChart from './BarChart';
import { useLocale, useTheme, useMessages } from 'hooks';
import { renderDateLabels, renderStatusTooltipPopup } from 'lib/charts';
export function PageviewsChart({ websiteId, data, unit, className, loading, ...props }) {
export function PageviewsChart({ websiteId, data, unit, loading, ...props }) {
const { formatMessage, labels } = useMessages();
const { colors } = useTheme();
const { locale } = useLocale();
@ -31,7 +31,6 @@ export function PageviewsChart({ websiteId, data, unit, className, loading, ...p
<BarChart
{...props}
key={websiteId}
className={className}
datasets={datasets}
unit={unit}
loading={loading}

View File

@ -93,9 +93,7 @@ export function RealtimePage({ websiteId }) {
<Page loading={isLoading} error={error}>
<WebsiteHeader websiteId={websiteId} />
<RealtimeHeader websiteId={websiteId} data={currentData} />
<div className={styles.chart}>
<RealtimeChart data={realtimeData} unit="minute" />
</div>
<RealtimeChart className={styles.chart} data={realtimeData} unit="minute" />
<GridRow>
<GridColumn xs={12} sm={12} md={12} lg={4} xl={4}>
<RealtimeUrls websiteId={websiteId} websiteDomain={website?.domain} data={realtimeData} />

View File

@ -1,4 +1,4 @@
import { addMinutes, differenceInMinutes } from 'date-fns';
import { subMinutes, differenceInMinutes } from 'date-fns';
import { NextApiResponse } from 'next';
import { methodNotAllowed, ok, unauthorized } from 'next-basics';
import { canViewWebsite } from 'lib/auth';
@ -53,8 +53,8 @@ export default async (
const { startDate, endDate } = await parseDateRangeQuery(req);
const diff = differenceInMinutes(endDate, startDate);
const prevStartDate = addMinutes(startDate, -diff);
const prevEndDate = addMinutes(endDate, -diff);
const prevStartDate = subMinutes(startDate, diff);
const prevEndDate = subMinutes(endDate, diff);
const metrics = await getWebsiteStats(websiteId, {
startDate,