mirror of
https://github.com/multipleof4/ntfy.git
synced 2026-10-12 23:05:20 +00:00
fmt
This commit is contained in:
@@ -130,7 +130,7 @@ const Layout = () => {
|
||||
const [selected] = (subscriptionsWithoutInternal || []).filter(
|
||||
(s) =>
|
||||
(params.baseUrl && expandUrl(params.baseUrl).includes(s.baseUrl) && params.topic === s.topic) ||
|
||||
(config.base_url === s.baseUrl && params.topic === s.topic)
|
||||
(config.base_url === s.baseUrl && params.topic === s.topic),
|
||||
);
|
||||
|
||||
useConnectionListeners(account, subscriptions, users, webPushTopics);
|
||||
|
||||
@@ -80,7 +80,7 @@ const SingleSubscriptionList = (props) => {
|
||||
// getAllNotifications() filtered by id), so topic switches are instant.
|
||||
const notifications = useMemo(
|
||||
() => allNotifications.filter((notification) => notification.subscriptionId === subscription.id),
|
||||
[allNotifications, subscription.id]
|
||||
[allNotifications, subscription.id],
|
||||
);
|
||||
if (notifications.length === 0) {
|
||||
return <NoNotifications subscription={subscription} />;
|
||||
@@ -104,7 +104,7 @@ const NotificationList = (props) => {
|
||||
main.scrollTo(0, 0);
|
||||
}
|
||||
},
|
||||
[props.id]
|
||||
[props.id],
|
||||
);
|
||||
|
||||
return (
|
||||
@@ -319,7 +319,7 @@ const Attachment = (props) => {
|
||||
infos.push(
|
||||
t("notifications_attachment_link_expires", {
|
||||
date: formatDateTime(attachment.expires, dateFormat, timeFormat),
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
if (expired) {
|
||||
|
||||
@@ -168,7 +168,7 @@ const PublishDialog = (props) => {
|
||||
loaded: formatBytes(ev.loaded),
|
||||
total: formatBytes(ev.total),
|
||||
percent: Math.round((ev.loaded * 100.0) / ev.total),
|
||||
})
|
||||
}),
|
||||
);
|
||||
} else {
|
||||
setStatus(t("publish_dialog_progress_uploading"));
|
||||
@@ -201,19 +201,19 @@ const PublishDialog = (props) => {
|
||||
t("publish_dialog_attachment_limits_file_and_quota_reached", {
|
||||
fileSizeLimit: formatBytes(fileSizeLimit),
|
||||
remainingBytes: formatBytes(remainingBytes),
|
||||
})
|
||||
}),
|
||||
);
|
||||
} else if (fileSizeLimitReached) {
|
||||
setAttachFileError(
|
||||
t("publish_dialog_attachment_limits_file_reached", {
|
||||
fileSizeLimit: formatBytes(fileSizeLimit),
|
||||
})
|
||||
}),
|
||||
);
|
||||
} else if (quotaReached) {
|
||||
setAttachFileError(
|
||||
t("publish_dialog_attachment_limits_quota_reached", {
|
||||
remainingBytes: formatBytes(remainingBytes),
|
||||
})
|
||||
}),
|
||||
);
|
||||
} else {
|
||||
setAttachFileError("");
|
||||
|
||||
@@ -93,7 +93,7 @@ const SubscribePage = (props) => {
|
||||
const { topic } = props;
|
||||
const existingTopicUrls = props.subscriptions.map((s) => topicUrl(s.baseUrl, s.topic));
|
||||
const existingBaseUrls = Array.from(new Set([publicBaseUrl, ...props.subscriptions.map((s) => s.baseUrl)])).filter(
|
||||
(s) => s !== config.base_url
|
||||
(s) => s !== config.base_url,
|
||||
);
|
||||
const showReserveTopicCheckbox = config.enable_reservations && !anotherServerVisible && (config.enable_payments || account);
|
||||
const reserveTopicEnabled =
|
||||
@@ -113,7 +113,7 @@ const SubscribePage = (props) => {
|
||||
setError(
|
||||
t("subscribe_dialog_error_user_not_authorized", {
|
||||
username,
|
||||
})
|
||||
}),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -120,14 +120,14 @@ export const SubscriptionPopup = (props) => {
|
||||
`Hello friend, this is a test notification from ntfy web. It's ${formatDateTime(
|
||||
nowSeconds,
|
||||
dateFormat,
|
||||
timeFormat
|
||||
timeFormat,
|
||||
)} right now. Is that early or late?`,
|
||||
`So I heard you like ntfy? If that's true, go to GitHub and star it, or to the Play store and rate it. Thanks! Oh yeah, this is a test notification.`,
|
||||
`It's almost like you want to hear what I have to say. I'm not even a machine. I'm just a sentence that Phil typed on a random Thursday.`,
|
||||
`Alright then, it's ${formatDateTime(
|
||||
nowSeconds,
|
||||
dateFormat,
|
||||
timeFormat
|
||||
timeFormat,
|
||||
)} already. Boy oh boy, where did the time go? I hope you're alright, friend.`,
|
||||
`There are nine million bicycles in Beijing That's a fact; It's a thing we can't deny. I wonder if that's true ...`,
|
||||
`I'm really excited that you're trying out ntfy. Did you know that there are a few public topics, such as ntfy.sh/stats and ntfy.sh/announcements.`,
|
||||
|
||||
@@ -30,7 +30,7 @@ export const useConnectionListeners = (account, subscriptions, users, webPushTop
|
||||
// wsSubscriptions should stay stable unless the list of subscription IDs changes. Without the memo, the connection
|
||||
// listener calls a refresh for no reason. This isn't a problem due to the makeConnectionId, but it triggers an
|
||||
// unnecessary recomputation for every received message.
|
||||
[JSON.stringify({ subscriptions: subscriptions?.map(({ id }) => id), webPushTopics })]
|
||||
[JSON.stringify({ subscriptions: subscriptions?.map(({ id }) => id), webPushTopics })],
|
||||
);
|
||||
|
||||
// Register listeners for incoming messages, and connection state changes
|
||||
@@ -103,7 +103,7 @@ export const useConnectionListeners = (account, subscriptions, users, webPushTop
|
||||
},
|
||||
// We have to disable dep checking for "navigate". This is fine, it never changes.
|
||||
|
||||
[]
|
||||
[],
|
||||
);
|
||||
|
||||
// Sync topic listener: For accounts with sync_topic, subscribe to an internal topic
|
||||
@@ -233,7 +233,7 @@ export const useWebPushTopics = () => {
|
||||
const topics = useLiveQuery(
|
||||
async () => subscriptionManager.webPushTopics(pushPossible),
|
||||
// invalidate (reload) query when these values change
|
||||
[pushPossible]
|
||||
[pushPossible],
|
||||
);
|
||||
|
||||
useWebPushListener(topics);
|
||||
|
||||
Reference in New Issue
Block a user