Fix bugs with threads (#1288)

* Fix bugs with threads

* remove modpack warning

* add back msg

* update project reveue info

* Add faq
This commit is contained in:
Geometrically
2023-08-09 18:02:12 -07:00
committed by GitHub
parent 70a173a16d
commit a437a40eee
11 changed files with 220 additions and 113 deletions

View File

@@ -136,8 +136,8 @@ export function groupNotifications(notifications, includeRead = false) {
if (notification.body) {
const index = grouped.findIndex(
(notif) =>
(notif.body.thread_id === notification.body.thread_id ||
notif.body.project_id === notification.body.project_id) &&
((notif.body.thread_id === notification.body.thread_id && !!notif.body.thread_id) ||
(notif.body.project_id === notification.body.project_id && !!notif.body.project_id)) &&
notification.read === notif.read
)
const notif = grouped[index]

View File

@@ -476,6 +476,10 @@ export default defineNuxtComponent({
},
},
mounted() {
if (process.client && window) {
window.history.scrollRestoration = 'auto'
}
this.runAnalytics()
},
methods: {

View File

@@ -44,7 +44,7 @@
"js-yaml": "^4.1.0",
"jszip": "^3.10.1",
"markdown-it": "^13.0.1",
"omorphia": "^0.4.35",
"omorphia": "^0.4.37",
"qrcode.vue": "^3.4.0",
"semver": "^7.5.4",
"vue-multiselect": "^3.0.0-alpha.2",

View File

@@ -378,15 +378,11 @@
class="card information"
aria-label="Information"
>
To install {{ project.title }}, visit
To install {{ project.title }}, download
<nuxt-link to="/app">the Modrinth App</nuxt-link>. For instructions with other launchers,
please see
<a href="https://docs.modrinth.com/docs/modpacks/playing_modpacks/" :target="$external()"
>our documentation</a
>
which provides instructions on using
<a href="https://atlauncher.com/about" :target="$external()" rel="noopener"> ATLauncher</a
>, <a href="https://multimc.org/" :target="$external()" rel="noopener">MultiMC</a>, and
<a href="https://prismlauncher.org" :target="$external()" rel="noopener">
Prism Launcher</a
>.
</div>
<Promotion v-if="tags.approvedStatuses.includes(project.status)" />

View File

@@ -12,97 +12,106 @@
</NuxtLink>
</div>
</section>
<section class="universal-card dashboard-notifications">
<div class="header__row">
<h2 class="header__title">Notifications</h2>
<nuxt-link v-if="notifications.length > 0" class="goto-link" to="/dashboard/notifications">
See all <ChevronRightIcon />
</nuxt-link>
</div>
<template v-if="notifications.length > 0">
<NotificationItem
v-for="notification in notifications"
:key="notification.id"
v-model:notifications="allNotifs"
class="universal-card recessed"
:notification="notification"
:auth="auth"
raised
compact
/>
<nuxt-link
v-if="extraNotifs > 0"
class="goto-link view-more-notifs"
to="/dashboard/notifications"
>
View {{ extraNotifs }} more notification{{ extraNotifs === 1 ? '' : 's' }}
<ChevronRightIcon />
</nuxt-link>
</template>
<div v-else class="universal-body">
<p>You have no unread notifications.</p>
<nuxt-link class="iconified-button" to="/dashboard/notifications">
<HistoryIcon /> View notification history
</nuxt-link>
</div>
</section>
<section class="universal-card dashboard-analytics">
<h2>Analytics</h2>
<div class="grid-display">
<div class="grid-display__item">
<div class="label">Total downloads</div>
<div class="value">
{{ $formatNumber(projects.reduce((agg, x) => agg + x.downloads, 0)) }}
</div>
<span
>from
{{ downloadsProjectCount }}
project{{ downloadsProjectCount === 1 ? '' : 's' }}</span
>
<!-- <NuxtLink class="goto-link" to="/dashboard/analytics"-->
<!-- >View breakdown-->
<!-- <ChevronRightIcon-->
<!-- class="featured-header-chevron"-->
<!-- aria-hidden="true"-->
<!-- /></NuxtLink>-->
</div>
<div class="grid-display__item">
<div class="label">Total followers</div>
<div class="value">
{{ $formatNumber(projects.reduce((agg, x) => agg + x.followers, 0)) }}
</div>
<span>
<span
>from {{ followersProjectCount }} project{{
followersProjectCount === 1 ? '' : 's'
}}</span
></span
>
</div>
<div class="grid-display__item">
<div class="label">Total revenue</div>
<div class="value">
{{ $formatMoney(payouts.all_time, true) }}
</div>
<span>{{ $formatMoney(payouts.last_month, true) }} in the last month</span>
</div>
<div class="grid-display__item">
<div class="label">Current balance</div>
<div class="value">
{{ $formatMoney(auth.user.payout_data.balance, true) }}
</div>
<NuxtLink
v-if="auth.user.payout_data.balance >= minWithdraw"
<div class="dashboard-notifications">
<section class="universal-card">
<div class="header__row">
<h2 class="header__title">Notifications</h2>
<nuxt-link
v-if="notifications.length > 0"
class="goto-link"
to="/dashboard/revenue"
to="/dashboard/notifications"
>
Withdraw earnings
<ChevronRightIcon class="featured-header-chevron" aria-hidden="true" />
</NuxtLink>
<span v-else>${{ minWithdraw }} is the withdraw minimum</span>
See all <ChevronRightIcon />
</nuxt-link>
</div>
</div>
</section>
<template v-if="notifications.length > 0">
<NotificationItem
v-for="notification in notifications"
:key="notification.id"
v-model:notifications="allNotifs"
class="universal-card recessed"
:notification="notification"
:auth="auth"
raised
compact
/>
<nuxt-link
v-if="extraNotifs > 0"
class="goto-link view-more-notifs"
to="/dashboard/notifications"
>
View {{ extraNotifs }} more notification{{ extraNotifs === 1 ? '' : 's' }}
<ChevronRightIcon />
</nuxt-link>
</template>
<div v-else class="universal-body">
<p>You have no unread notifications.</p>
<nuxt-link class="iconified-button" to="/dashboard/notifications">
<HistoryIcon /> View notification history
</nuxt-link>
</div>
</section>
</div>
<div class="dashboard-analytics">
<section class="universal-card">
<h2>Analytics</h2>
<div class="grid-display">
<div class="grid-display__item">
<div class="label">Total downloads</div>
<div class="value">
{{ $formatNumber(projects.reduce((agg, x) => agg + x.downloads, 0)) }}
</div>
<span
>from
{{ downloadsProjectCount }}
project{{ downloadsProjectCount === 1 ? '' : 's' }}</span
>
<!-- <NuxtLink class="goto-link" to="/dashboard/analytics"-->
<!-- >View breakdown-->
<!-- <ChevronRightIcon-->
<!-- class="featured-header-chevron"-->
<!-- aria-hidden="true"-->
<!-- /></NuxtLink>-->
</div>
<div class="grid-display__item">
<div class="label">Total followers</div>
<div class="value">
{{ $formatNumber(projects.reduce((agg, x) => agg + x.followers, 0)) }}
</div>
<span>
<span
>from {{ followersProjectCount }} project{{
followersProjectCount === 1 ? '' : 's'
}}</span
></span
>
</div>
<div class="grid-display__item">
<div class="label">Total revenue</div>
<div class="value">
{{ $formatMoney(payouts.all_time, true) }}
</div>
<span>{{ $formatMoney(payouts.last_month, true) }} in the last month</span>
</div>
<div class="grid-display__item">
<div class="label">Current balance</div>
<div class="value">
{{ $formatMoney(auth.user.payout_data.balance, true) }}
</div>
<NuxtLink
v-if="auth.user.payout_data.balance >= minWithdraw"
class="goto-link"
to="/dashboard/revenue"
>
Withdraw earnings
<ChevronRightIcon class="featured-header-chevron" aria-hidden="true" />
</NuxtLink>
<span v-else>${{ minWithdraw }} is the withdraw minimum</span>
</div>
</div>
</section>
</div>
</div>
</template>
<script setup>

View File

@@ -321,10 +321,7 @@
</svg>
</div>
<h3>Monetization</h3>
<p>
Get paid 100% of the ad revenue from your project pages and withdraw your funds at any
time
</p>
<p>Get paid ad revenue from your project pages and withdraw your funds at any time</p>
</div>
<div class="feature gradient-border">
<div class="icon gradient-border">

View File

@@ -25,6 +25,9 @@
<NavStackItem link="/legal/cmp" label="Rewards Program Terms">
<CurrencyIcon />
</NavStackItem>
<NavStackItem link="/legal/cmp-info" label="Rewards Program Info">
<InfoIcon />
</NavStackItem>
</NavStack>
</aside>
</div>

97
pages/legal/cmp-info.vue Normal file
View File

@@ -0,0 +1,97 @@
<template>
<div class="markdown-body">
<h1>Rewards Program Information</h1>
<p><em>Last edited: August 9, 2023</em></p>
<p>
This page was created for transparency for how the rewards program works on Modrinth. Feel
free to join our Discord or email support@modrinth.com if you have any questions!
</p>
<p>
This document is provided for informational purposes only and does not constitute a legal
agreement. Modrinth makes no representations or warranties as to the accuracy, completeness,
or reliability of the information contained herein.
</p>
<h2>Rewards Distribution</h2>
<p>
We collect ad revenue on our website and app through our ad network
<a href="https://adrinth.com">Adrinth</a>. We then distribute this ad revenue to creators.
</p>
<p>
The advertising revenue of the entire website and app is split 90% to creators and 10% to
Modrinth.
</p>
<p>
The creator allotment to the pool is decided by how many page views and in-app downloads your
project receives (user profiles are not used in this calculation). Each page view and in-app
download counts as a "point". Then, the money is distributed based on each author's point
earnings daily.
</p>
<p>For example, consider this test scenario (all numbers are fake):</p>
<ul>
<li>The site earns $100 on a day.</li>
<li>User A has the projects: NoobCraft and Minesweeper</li>
<li>NoobCraft receives 10 page views and 30 in-app downloads (40 points)</li>
<li>Minesweeper receives 100 page views and 10 in-app downloads (110 points)</li>
<li>
User B and C both co-own these projects: Bloxcraft and Craftnite. They split their payouts
40/60.
</li>
<li>Bloxcraft receives 50 page views and 20 in-app downloads (70 points)</li>
<li>Craftnite receives 10 page views and 0 in-app downloads (10 points)</li>
</ul>
<p>In this scenario, the earnings for each creator and Modrinth would be as follows:</p>
<ul>
<li>Modrinth: $10 (10% of $100, the site's earnings for the day)</li>
<li>User A: $58.69 ($90 * (10 + 30 + 100 + 10)/230)</li>
<li>User B: $12.52 (0.4 * $90 * (50 + 20 + 10 + 0)/230)</li>
<li>User C: $18.78 (0.6 * $90 * (50 + 20 + 10 + 0)/230)</li>
<li>Note: 230 is the sum of all page views and in-app downloads from above</li>
</ul>
<p>
Page views are counted when a legitimate browser views a project page. In-app downloads when a
user logged into the launcher downloads a project. Project downloads alongside modpack
downloads are counted equally. In each category, Modrinth actively removes botted downloads
and page views at our own discretion. If users are caught botting, they will be permanently
banned from using Modrinth's services.
</p>
<p>
Currently, there is no way to view page views or in-app downloads information for your
projects. We are currently working on an analytics dashboard which will display this
information.
</p>
<h2>Frequently Asked Questions</h2>
<p>
This section covers some common concerns people have about our monetization program. If you
have more, feel free to join our Discord or contact support.
</p>
<h3>Do you have to enroll in the monetization program to get money?</h3>
<p>
No. All creators who upload to Modrinth automatically will receive funds as according to the
above algorithm. However, if you would like to withdraw money from your account, you must
enroll by adding your payment information.
</p>
<h3>What methods can I use withdraw money from my account? Are there any fees?</h3>
<p>
Right now, you can use PayPal or Venmo to withdraw money from your Modrinth account. We are
working on more methods to withdraw money from your account. There are fees to withdraw money
from your Modrinth account—see the revenue page in your dashboard for more information.
</p>
<h3>Modrinth used to give 100% of project page revenue to creators. What changed?</h3>
<p>
While this is true, our new system (as of 08/05/23) gives more of the site's revenue to
creators, so creators will earn more. In the old system, we would earn revenue through
advertisements in search and user profile pages. This amounted on average each month to about
15-20% of the site's total advertising revenue (so a 80-85% split to creators). The new system
gives creators more revenue and a more favorable split towards creators (90%).
</p>
<h3></h3>
</div>
</template>
<script>
export default {
name: 'CmpInfo',
}
</script>
<style scoped></style>

View File

@@ -17,11 +17,12 @@
Policy, which can be found at https://modrinth.com/legal/privacy.
</p>
<p>
<strong>Economics:</strong> Rinth shall pay to you the percentage set forth here (90%) of net
revenue collected by Rinth attributable to ad impressions displayed solely on your creator
page excluding transaction fees (Revenue Share). Rinth shall make Revenue Share payments to
you when you withdraw funds from Rinth's dashboard. Rinth shall include with each such payment
either access to a dashboard or other reasonable reporting detailing the calculation thereof.
<strong>Economics:</strong> Rinth shall pay to you the percentage set forth
<nuxt-link to="/legal/cmp-info">here</nuxt-link> of net revenue collected by Rinth
attributable to ad impressions displayed on modrinth.com and the Modrinth App excluding
transaction fees (Revenue Share). Rinth shall make Revenue Share payments to you when you
withdraw funds from Rinth's dashboard. Rinth shall include with each such payment either
access to a dashboard or other reasonable reporting detailing the calculation thereof.
</p>
<p>
<strong>Relationship:</strong> Your relationship with Rinth relating to the Rewards Program is

View File

@@ -179,7 +179,7 @@
id="verify-code"
v-model="twoFactorCode"
maxlength="6"
type="number"
type="text"
placeholder="Enter code..."
/>
<p v-if="twoFactorIncorrect" class="known-errors">The code entered is incorrect!</p>
@@ -511,7 +511,7 @@ async function verifyTwoFactorCode() {
const res = await useBaseFetch('auth/2fa', {
method: 'POST',
body: {
code: twoFactorCode.value ? twoFactorCode.value.toString() : '',
code: twoFactorCode.value ? twoFactorCode.value : '',
flow: twoFactorFlow.value,
},
})

8
pnpm-lock.yaml generated
View File

@@ -32,8 +32,8 @@ dependencies:
specifier: ^13.0.1
version: 13.0.1(patch_hash=3vlxaukqep4gvqytxeznhg6wbq)
omorphia:
specifier: ^0.4.35
version: 0.4.35
specifier: ^0.4.37
version: 0.4.37
qrcode.vue:
specifier: ^3.4.0
version: 3.4.0(vue@3.3.4)
@@ -5410,8 +5410,8 @@ packages:
resolution: {integrity: sha512-9CIOSq5945rI045GFtcO3uudyOkYVY1nyfFxVQp+9BRgslr8jPNiSSrsFGg/BNTUFOLqx0P5tng6G32brIPw0w==}
dev: true
/omorphia@0.4.35:
resolution: {integrity: sha512-ZxA6sJKWZbiG49l/gTG25cxAvTcIfVSLhuIV2e+LSY0nwkZO4EFvxhzGNz0exR3lVs+OdDCdJyb1U2QYMVbVrA==}
/omorphia@0.4.37:
resolution: {integrity: sha512-q5crkohQQCzmY9q6X7BA02+rWbhYL5SkF7xVgb0H38TwxRCWPnbaQu8wR7vRt8QxmVY7pyijlzYzBNnJFd7egw==}
dependencies:
dayjs: 1.11.7
floating-vue: 2.0.0-beta.20(vue@3.3.4)