Compare commits
No commits in common. "36e9f3f16fd3ef0ea7edf32fe84ab252f7f53020" and "855afcb1de6227f64743a80e78bfcbc30ec0ab28" have entirely different histories.
36e9f3f16f
...
855afcb1de
@ -227,7 +227,7 @@ export async function onPaid ({ invoice, id }, context) {
|
|||||||
for (const { refereeItem } of item.itemReferrers) {
|
for (const { refereeItem } of item.itemReferrers) {
|
||||||
notifyItemMention({ models, referrerItem: item, refereeItem }).catch(console.error)
|
notifyItemMention({ models, referrerItem: item, refereeItem }).catch(console.error)
|
||||||
}
|
}
|
||||||
notifyUserSubscribers({ models: tx, item }).catch(console.error)
|
notifyUserSubscribers({ models, item }).catch(console.error)
|
||||||
notifyTerritorySubscribers({ models, item }).catch(console.error)
|
notifyTerritorySubscribers({ models, item }).catch(console.error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,6 @@ import { UNKNOWN_LINK_REL } from '@/lib/constants'
|
|||||||
import isEqual from 'lodash/isEqual'
|
import isEqual from 'lodash/isEqual'
|
||||||
import UserPopover from './user-popover'
|
import UserPopover from './user-popover'
|
||||||
import ItemPopover from './item-popover'
|
import ItemPopover from './item-popover'
|
||||||
import classNames from 'classnames'
|
|
||||||
|
|
||||||
// Explicitely defined start/end tags & which CSS class from text.module.css to apply
|
// Explicitely defined start/end tags & which CSS class from text.module.css to apply
|
||||||
export const rehypeSuperscript = () => rehypeStyler('<sup>', '</sup>', styles.superscript)
|
export const rehypeSuperscript = () => rehypeStyler('<sup>', '</sup>', styles.superscript)
|
||||||
@ -265,7 +264,7 @@ export default memo(function Text ({ rel, imgproxyUrls, children, tab, itemId, o
|
|||||||
const rehypePlugins = useMemo(() => [rehypeInlineCodeProperty, rehypeSuperscript, rehypeSubscript], [])
|
const rehypePlugins = useMemo(() => [rehypeInlineCodeProperty, rehypeSuperscript, rehypeSubscript], [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(styles.text, topLevel && styles.topLevel, show ? styles.textUncontained : overflowing && styles.textContained)} ref={containerRef}>
|
<div className={`${styles.text} ${show ? styles.textUncontained : overflowing ? styles.textContained : ''}`} ref={containerRef}>
|
||||||
<ReactMarkdown
|
<ReactMarkdown
|
||||||
components={components}
|
components={components}
|
||||||
remarkPlugins={remarkPlugins}
|
remarkPlugins={remarkPlugins}
|
||||||
|
@ -106,12 +106,6 @@
|
|||||||
margin-bottom: .5rem;
|
margin-bottom: .5rem;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
--grid-gap: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text.topLevel .p {
|
|
||||||
margin-bottom: 0.75rem;
|
|
||||||
--grid-gap: 0.75rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.text pre {
|
.text pre {
|
||||||
@ -134,55 +128,17 @@
|
|||||||
margin-bottom: .5rem;
|
margin-bottom: .5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mediaContainer {
|
.text .mediaContainer {
|
||||||
display: block;
|
display: block;
|
||||||
|
margin-top: .5rem;
|
||||||
margin-bottom: .5rem;
|
margin-bottom: .5rem;
|
||||||
width: calc(100% - var(--grid-gap));
|
width: 100%;
|
||||||
max-width: calc(100% - var(--grid-gap));
|
|
||||||
height: auto;
|
height: auto;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
max-height: 25vh;
|
max-height: 25vh;
|
||||||
aspect-ratio: var(--aspect-ratio);
|
aspect-ratio: var(--aspect-ratio);
|
||||||
}
|
}
|
||||||
|
|
||||||
.p:has(> .mediaContainer:only-child) ~ .p:has(> .mediaContainer:only-child) {
|
|
||||||
display: inline-block;
|
|
||||||
width: min-content;
|
|
||||||
max-width: calc(100% - var(--grid-gap));
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mediaContainer ~ .mediaContainer {
|
|
||||||
display: inline-block;
|
|
||||||
width: min-content;
|
|
||||||
margin-right: var(--grid-gap);
|
|
||||||
}
|
|
||||||
|
|
||||||
.p:has(> .mediaContainer:only-child) ~ .p:has(> .mediaContainer:only-child) > .mediaContainer:only-child {
|
|
||||||
margin-right: var(--grid-gap);
|
|
||||||
}
|
|
||||||
|
|
||||||
.p:has(> .mediaContainer:only-child):has(+ .p > .mediaContainer:only-child) {
|
|
||||||
display: inline-block;
|
|
||||||
width: min-content;
|
|
||||||
max-width: calc(100% - var(--grid-gap));
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p:has(> .mediaContainer:only-child):has(+ .p > .mediaContainer:only-child) > .mediaContainer:only-child {
|
|
||||||
margin-right: var(--grid-gap);
|
|
||||||
}
|
|
||||||
|
|
||||||
.mediaContainer:has(+ .mediaContainer) {
|
|
||||||
display: inline-block;
|
|
||||||
width: min-content;
|
|
||||||
margin-right: var(--grid-gap);
|
|
||||||
}
|
|
||||||
|
|
||||||
.mediaContainer:first-child:has(+ .mediaContainer) {
|
|
||||||
margin-top: var(--grid-gap);
|
|
||||||
}
|
|
||||||
|
|
||||||
.mediaContainer img, .mediaContainer video {
|
.mediaContainer img, .mediaContainer video {
|
||||||
display: block;
|
display: block;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
@ -190,7 +146,6 @@
|
|||||||
max-height: inherit;
|
max-height: inherit;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
aspect-ratio: var(--aspect-ratio);
|
aspect-ratio: var(--aspect-ratio);
|
||||||
block-size: stretch;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.mediaContainer img {
|
.mediaContainer img {
|
||||||
@ -200,6 +155,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.mediaContainer.topLevel {
|
.mediaContainer.topLevel {
|
||||||
|
margin-top: .75rem;
|
||||||
margin-bottom: .75rem;
|
margin-bottom: .75rem;
|
||||||
max-height: 35vh;
|
max-height: 35vh;
|
||||||
}
|
}
|
||||||
@ -234,7 +190,7 @@ img.fullScreen {
|
|||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text li {
|
.text li+li {
|
||||||
margin-top: .25rem;
|
margin-top: .25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,12 +260,12 @@ img.fullScreen {
|
|||||||
|
|
||||||
.videoWrapper {
|
.videoWrapper {
|
||||||
max-width: 320px;
|
max-width: 320px;
|
||||||
margin: 0.5rem 0;
|
padding-right: 15px;
|
||||||
|
margin: '0.5rem 0',
|
||||||
}
|
}
|
||||||
|
|
||||||
.videoWrapper.topLevel {
|
.videoWrapper.topLevel {
|
||||||
max-width: 640px;
|
max-width: 640px;
|
||||||
margin: 0.75rem 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.videoContainer {
|
.videoContainer {
|
||||||
|
@ -129,15 +129,7 @@ export const notifyUserSubscribers = async ({ models, item }) => {
|
|||||||
INNER JOIN users ON users.id = "UserSubscription"."followeeId"
|
INNER JOIN users ON users.id = "UserSubscription"."followeeId"
|
||||||
WHERE "followeeId" = $1 AND ${isPost ? '"postsSubscribedAt"' : '"commentsSubscribedAt"'} IS NOT NULL
|
WHERE "followeeId" = $1 AND ${isPost ? '"postsSubscribedAt"' : '"commentsSubscribedAt"'} IS NOT NULL
|
||||||
AND NOT EXISTS (SELECT 1 FROM "Mute" WHERE "Mute"."muterId" = "UserSubscription"."followerId" AND "Mute"."mutedId" = $1)
|
AND NOT EXISTS (SELECT 1 FROM "Mute" WHERE "Mute"."muterId" = "UserSubscription"."followerId" AND "Mute"."mutedId" = $1)
|
||||||
-- ignore subscription if user was already notified of item as a reply
|
`, Number(item.userId))
|
||||||
AND NOT EXISTS (
|
|
||||||
SELECT 1 FROM "Reply"
|
|
||||||
INNER JOIN users follower ON follower.id = "UserSubscription"."followerId"
|
|
||||||
WHERE "Reply"."itemId" = $2
|
|
||||||
AND "Reply"."ancestorUserId" = follower.id
|
|
||||||
AND follower."noteAllDescendants"
|
|
||||||
)
|
|
||||||
`, Number(item.userId), Number(item.id))
|
|
||||||
const subType = isPost ? 'POST' : 'COMMENT'
|
const subType = isPost ? 'POST' : 'COMMENT'
|
||||||
const tag = `FOLLOW-${item.userId}-${subType}`
|
const tag = `FOLLOW-${item.userId}-${subType}`
|
||||||
await Promise.allSettled(userSubsExcludingMutes.map(({ followerId, followeeName }) => sendUserNotification(followerId, {
|
await Promise.allSettled(userSubsExcludingMutes.map(({ followerId, followeeName }) => sendUserNotification(followerId, {
|
||||||
|
@ -107,8 +107,8 @@ export default function Settings ({ ssrData }) {
|
|||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<div className='pb-3 w-100 mt-2' style={{ maxWidth: '600px' }}>
|
<div className='pb-3 w-100 mt-2' style={{ maxWidth: '600px' }}>
|
||||||
<SettingsHeader />
|
|
||||||
{hasOnlyOneAuthMethod(settings?.authMethods) && <AuthBanner />}
|
{hasOnlyOneAuthMethod(settings?.authMethods) && <AuthBanner />}
|
||||||
|
<SettingsHeader />
|
||||||
<Form
|
<Form
|
||||||
initial={{
|
initial={{
|
||||||
tipDefault: settings?.tipDefault || 21,
|
tipDefault: settings?.tipDefault || 21,
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
.fullItemContainer {
|
.fullItemContainer {
|
||||||
margin-bottom: .5rem;
|
margin-bottom: .5rem;
|
||||||
padding-right: 15px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.fullItemContainer:empty {
|
.fullItemContainer:empty {
|
||||||
|
@ -45,6 +45,12 @@ export function useWallet (name) {
|
|||||||
logger.info('payments disabled')
|
logger.info('payments disabled')
|
||||||
}, [name, me, logger])
|
}, [name, me, logger])
|
||||||
|
|
||||||
|
if (wallet) {
|
||||||
|
wallet.isConfigured = _isConfigured
|
||||||
|
wallet.enablePayments = enablePayments
|
||||||
|
wallet.disablePayments = disablePayments
|
||||||
|
}
|
||||||
|
|
||||||
const status = config?.enabled ? Status.Enabled : Status.Initialized
|
const status = config?.enabled ? Status.Enabled : Status.Initialized
|
||||||
const enabled = status === Status.Enabled
|
const enabled = status === Status.Enabled
|
||||||
const priority = config?.priority
|
const priority = config?.priority
|
||||||
@ -89,30 +95,21 @@ export function useWallet (name) {
|
|||||||
|
|
||||||
if (!wallet) return null
|
if (!wallet) return null
|
||||||
|
|
||||||
// Assign everything to wallet object so every function that is passed this wallet object in this
|
return {
|
||||||
// `useWallet` hook has access to all others via the reference to it.
|
...wallet,
|
||||||
// Essentially, you can now use functions like `enablePayments` _inside_ of functions that are
|
canSend: !!wallet.sendPayment,
|
||||||
// called by `useWallet` even before enablePayments is defined and not only in functions
|
sendPayment,
|
||||||
// that use the return value of `useWallet`.
|
config,
|
||||||
wallet.isConfigured = _isConfigured
|
save,
|
||||||
wallet.enablePayments = enablePayments
|
delete: delete_,
|
||||||
wallet.disablePayments = disablePayments
|
deleteLogs,
|
||||||
wallet.canSend = !!wallet.sendPayment
|
setPriority,
|
||||||
wallet.canReceive = !!wallet.createInvoice
|
hasConfig,
|
||||||
wallet.config = config
|
status,
|
||||||
wallet.save = save
|
enabled,
|
||||||
wallet.delete = delete_
|
priority,
|
||||||
wallet.deleteLogs = deleteLogs
|
logger
|
||||||
wallet.setPriority = setPriority
|
}
|
||||||
wallet.hasConfig = hasConfig
|
|
||||||
wallet.status = status
|
|
||||||
wallet.enabled = enabled
|
|
||||||
wallet.priority = priority
|
|
||||||
wallet.logger = logger
|
|
||||||
|
|
||||||
// can't assign sendPayment to wallet object because it already exists
|
|
||||||
// as an imported function and thus can't be overwritten
|
|
||||||
return { ...wallet, sendPayment }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function extractConfig (fields, config, client) {
|
function extractConfig (fields, config, client) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user