@@ -198,6 +198,11 @@ export default {
required: false,
default: true,
},
+ showCreatedDate: {
+ type: Boolean,
+ required: false,
+ default: true,
+ },
hideLoaders: {
type: Boolean,
required: false,
diff --git a/composables/cosmetics.js b/composables/cosmetics.js
index 160aa6e0f..307c59632 100644
--- a/composables/cosmetics.js
+++ b/composables/cosmetics.js
@@ -25,6 +25,7 @@ export const useCosmetics = () =>
shader: 'gallery',
datapack: 'list',
user: 'list',
+ collection: 'list',
},
}
}
diff --git a/composables/user.js b/composables/user.js
index fc32f7730..085720497 100644
--- a/composables/user.js
+++ b/composables/user.js
@@ -19,12 +19,12 @@ export const initUser = async () => {
if (auth.user && auth.user.id) {
try {
- const [notifications, follows] = await Promise.all([
- useBaseFetch(`user/${auth.user.id}/notifications`),
+ const [follows, collections] = await Promise.all([
useBaseFetch(`user/${auth.user.id}/follows`),
+ useBaseFetch(`user/${auth.user.id}/collections`, { apiVersion: 3 }),
])
- user.notifications = notifications
+ user.collections = collections
user.follows = follows
user.lastUpdated = Date.now()
} catch (err) {
@@ -35,13 +35,13 @@ export const initUser = async () => {
return user
}
-export const initUserNotifs = async () => {
+export const initUserCollections = async () => {
const auth = (await useAuth()).value
const user = (await useUser()).value
if (auth.user && auth.user.id) {
try {
- user.notifications = await useBaseFetch(`user/${auth.user.id}/notifications`)
+ user.collections = await useBaseFetch(`user/${auth.user.id}/collections`, { apiVersion: 3 })
} catch (err) {
console.error(err)
}
@@ -74,6 +74,28 @@ export const initUserProjects = async () => {
}
}
+export const userCollectProject = async (collection, projectId) => {
+ const user = (await useUser()).value
+
+ const add = !collection.projects.includes(projectId)
+ const projects = add
+ ? [...collection.projects, projectId]
+ : [...collection.projects].filter((x) => x !== projectId)
+
+ const idx = user.collections.findIndex((x) => x.id === collection.id)
+ if (idx >= 0) {
+ user.collections[idx].projects = projects
+ }
+
+ await useBaseFetch(`collection/${collection.id}`, {
+ method: 'PATCH',
+ body: {
+ new_projects: projects,
+ },
+ apiVersion: 3,
+ })
+}
+
export const userFollowProject = async (project) => {
const user = (await useUser()).value
@@ -100,29 +122,6 @@ export const userUnfollowProject = async (project) => {
})
}
-export const userDeleteNotification = async (id) => {
- const user = (await useUser()).value
-
- user.notifications = user.notifications.filter((x) => x.id !== id)
-}
-
-export const userDeleteNotifications = async (ids) => {
- const user = (await useUser()).value
-
- user.notifications = user.notifications.filter((x) => !ids.includes(x.id))
-}
-
-export const userReadNotifications = async (ids) => {
- const user = (await useUser()).value
-
- user.notifications = user.notifications.map((x) => {
- if (ids.includes(x.id)) {
- x.read = true
- }
- return x
- })
-}
-
export const resendVerifyEmail = async () => {
const app = useNuxtApp()
diff --git a/helpers/notifications.js b/helpers/notifications.js
index 1c8448f27..193f7fa55 100644
--- a/helpers/notifications.js
+++ b/helpers/notifications.js
@@ -1,5 +1,4 @@
import { useNuxtApp } from '#app'
-import { userReadNotifications } from '~/composables/user.js'
async function getBulk(type, ids) {
if (ids.length === 0) {
@@ -168,7 +167,6 @@ export async function markAsRead(ids) {
await useBaseFetch(`notifications?ids=${JSON.stringify([...new Set(ids)])}`, {
method: 'PATCH',
})
- await userReadNotifications(ids)
return (notifications) => {
const newNotifs = notifications
newNotifs.forEach((notif) => {
diff --git a/layouts/default.vue b/layouts/default.vue
index 20bdb344e..a7228e113 100644
--- a/layouts/default.vue
+++ b/layouts/default.vue
@@ -33,7 +33,6 @@
v-if="auth.user"
to="/dashboard/notifications"
class="control-button button-transparent"
- :class="{ bubble: user.notifications.some((notif) => !notif.read) }"
title="Notifications"
>
@@ -86,9 +85,9 @@
Dashboard
-
-
- Following
+
+
+ Collections
@@ -236,7 +235,6 @@
to="/dashboard/notifications"
class="tab button-animation"
:class="{
- bubble: user.notifications.some((notif) => !notif.read),
'no-active': isMobileMenuOpen || isBrowseMenuOpen,
}"
title="Notifications"
@@ -359,7 +357,7 @@
+
+
diff --git a/pages/collection/[id]/[projectType].vue b/pages/collection/[id]/[projectType].vue
new file mode 100644
index 000000000..355338565
--- /dev/null
+++ b/pages/collection/[id]/[projectType].vue
@@ -0,0 +1 @@
+
diff --git a/pages/dashboard.vue b/pages/dashboard.vue
index c85b47e43..2eb3a4b31 100644
--- a/pages/dashboard.vue
+++ b/pages/dashboard.vue
@@ -24,6 +24,9 @@
+
+
+
@@ -36,7 +39,7 @@
+
diff --git a/pages/dashboard/follows.vue b/pages/dashboard/follows.vue
index 42233069f..9f4c0cf33 100644
--- a/pages/dashboard/follows.vue
+++ b/pages/dashboard/follows.vue
@@ -15,6 +15,7 @@
:client-side="project.client_side"
:server-side="project.server_side"
:color="project.color"
+ :show-updated-date="false"
>