Compare commits
No commits in common. "94cc3b38d5eea1f986759b4d140f7f1d587cdaf2" and "eb423b48868475b5f7f6935843eafed5410ee224" have entirely different histories.
94cc3b38d5
...
eb423b4886
|
@ -28,37 +28,19 @@
|
||||||
</template>
|
</template>
|
||||||
</VDropdown>
|
</VDropdown>
|
||||||
|
|
||||||
<template v-if="pageStash?.user.id === user.id">
|
<Icon
|
||||||
<Icon
|
v-if="itemStashes.some((itemStash) => itemStash.id === currentStash.id)"
|
||||||
v-if="itemStashes.some((itemStash) => itemStash.id === pageStash.id)"
|
:icon="currentStash.isPrimary ? 'heart7' : 'folder-heart'"
|
||||||
:icon="pageStash.isPrimary ? 'heart7' : 'folder-heart'"
|
class="heart favorited noselect"
|
||||||
class="heart favorited noselect"
|
@click.native.stop="unstashItem(currentStash)"
|
||||||
@click.native.stop="unstashItem(pageStash)"
|
/>
|
||||||
/>
|
|
||||||
|
|
||||||
<Icon
|
<Icon
|
||||||
v-else
|
v-else
|
||||||
:icon="pageStash.isPrimary ? 'heart8' : 'folder-heart'"
|
:icon="currentStash.isPrimary ? 'heart8' : 'folder-heart'"
|
||||||
class="heart noselect"
|
class="heart noselect"
|
||||||
@click.native.stop="stashItem(pageStash)"
|
@click.native.stop="stashItem(currentStash)"
|
||||||
/>
|
/>
|
||||||
</template>
|
|
||||||
|
|
||||||
<template v-else>
|
|
||||||
<Icon
|
|
||||||
v-if="itemStashes.some((itemStash) => itemStash.id === user.primaryStash.id)"
|
|
||||||
icon="heart7"
|
|
||||||
class="heart favorited noselect"
|
|
||||||
@click.native.stop="unstashItem(user.primaryStash)"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Icon
|
|
||||||
v-else
|
|
||||||
icon="heart8"
|
|
||||||
class="heart noselect"
|
|
||||||
@click.native.stop="stashItem(user.primaryStash)"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -89,7 +71,7 @@ const props = defineProps({
|
||||||
const emit = defineEmits(['stashed', 'unstashed']);
|
const emit = defineEmits(['stashed', 'unstashed']);
|
||||||
|
|
||||||
const { user, pageProps } = inject('pageContext');
|
const { user, pageProps } = inject('pageContext');
|
||||||
const pageStash = pageProps.stash;
|
const currentStash = pageProps.stash || user?.primaryStash;
|
||||||
|
|
||||||
const itemStashes = ref(props.item.stashes);
|
const itemStashes = ref(props.item.stashes);
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
{
|
{
|
||||||
"name": "traxxx-web",
|
"name": "traxxx-web",
|
||||||
"version": "0.17.10",
|
"version": "0.17.9",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"version": "0.17.10",
|
"version": "0.17.9",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@brillout/json-serializer": "^0.5.8",
|
"@brillout/json-serializer": "^0.5.8",
|
||||||
"@dicebear/collection": "^7.0.5",
|
"@dicebear/collection": "^7.0.5",
|
||||||
|
|
|
@ -72,5 +72,5 @@
|
||||||
"postcss-custom-media": "^10.0.2",
|
"postcss-custom-media": "^10.0.2",
|
||||||
"postcss-nesting": "^12.0.2"
|
"postcss-nesting": "^12.0.2"
|
||||||
},
|
},
|
||||||
"version": "0.17.10"
|
"version": "0.17.9"
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
v-if="scene.channel.hasLogo"
|
v-if="scene.channel.hasLogo"
|
||||||
:src="scene.channel.isIndependent || !scene.network ? `/logos/${scene.channel.slug}/thumbs/network.png` : `/logos/${scene.network.slug}/thumbs/${scene.channel.slug}.png`"
|
:src="scene.channel.isIndependent || !scene.network ? `/logos/${scene.channel.slug}/network.png` : `/logos/${scene.network.slug}/${scene.channel.slug}.png`"
|
||||||
class="channel-logo entity-logo"
|
class="channel-logo entity-logo"
|
||||||
>
|
>
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -87,12 +87,12 @@
|
||||||
>
|
>
|
||||||
by
|
by
|
||||||
<Link
|
<Link
|
||||||
:href="`/${scene.network.type}/thumbs/${scene.network.slug}`"
|
:href="`/${scene.network.type}/${scene.network.slug}`"
|
||||||
class="network-link entity-link"
|
class="network-link entity-link"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
v-if="scene.network.hasLogo"
|
v-if="scene.network.hasLogo"
|
||||||
:src="`/logos/${scene.network.slug}/thumbs/network.png`"
|
:src="`/logos/${scene.network.slug}/network.png`"
|
||||||
class="network-logo entity-logo"
|
class="network-logo entity-logo"
|
||||||
>
|
>
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -371,13 +371,11 @@ const poster = computed(() => {
|
||||||
|
|
||||||
.meta {
|
.meta {
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 3.25rem;
|
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: stretch;
|
align-items: center;
|
||||||
background: var(--grey-dark-40);
|
background: var(--grey-dark-40);
|
||||||
border-radius: 0 0 .5rem .5rem;
|
border-radius: 0 0 .5rem .5rem;
|
||||||
color: var(--text-light);
|
color: var(--text-light);
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.entity {
|
.entity {
|
||||||
|
@ -388,23 +386,18 @@ const poster = computed(() => {
|
||||||
}
|
}
|
||||||
|
|
||||||
.entity-link {
|
.entity-link {
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: .5rem 1rem;
|
padding: .5rem 1rem;
|
||||||
height: 100%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.entity-logo {
|
.entity-logo {
|
||||||
max-width: 15rem;
|
width: 10rem;
|
||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
|
object-fit: contain;
|
||||||
}
|
}
|
||||||
|
|
||||||
.network-container {
|
.network-container {
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.date {
|
.date {
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
import IPCIDR from 'ip-cidr';
|
import IPCIDR from 'ip-cidr';
|
||||||
|
|
||||||
import { login, signup } from '../auth.js';
|
import { login, signup } from '../auth.js';
|
||||||
import { fetchUser } from '../users.js';
|
|
||||||
|
|
||||||
function getIp(req) {
|
function getIp(req) {
|
||||||
const ip = req.headers['x-forwarded-for']?.split(',')[0] || req.connection.remoteAddress; // See src/ws
|
const ip = req.headers['x-forwarded-for']?.split(',')[0] || req.connection.remoteAddress; // See src/ws
|
||||||
|
@ -36,15 +35,6 @@ export async function setUserApi(req, res, next) {
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateSessionUser(req) {
|
|
||||||
const user = await fetchUser(req.session.user.id, {}, req.session.user);
|
|
||||||
|
|
||||||
req.session.user = user;
|
|
||||||
|
|
||||||
req.user = user;
|
|
||||||
req.user.ip = req.userIp;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function loginApi(req, res) {
|
export async function loginApi(req, res) {
|
||||||
const user = await login(req.body, req.userIp);
|
const user = await login(req.body, req.userIp);
|
||||||
|
|
||||||
|
|
|
@ -10,27 +10,20 @@ import {
|
||||||
updateStash,
|
updateStash,
|
||||||
} from '../stashes.js';
|
} from '../stashes.js';
|
||||||
|
|
||||||
import { updateSessionUser } from './auth.js';
|
|
||||||
|
|
||||||
export async function createStashApi(req, res) {
|
export async function createStashApi(req, res) {
|
||||||
const stash = await createStash(req.body, req.session.user);
|
const stash = await createStash(req.body, req.session.user);
|
||||||
|
|
||||||
await updateSessionUser(req);
|
|
||||||
|
|
||||||
res.send(stash);
|
res.send(stash);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateStashApi(req, res) {
|
export async function updateStashApi(req, res) {
|
||||||
const stash = await updateStash(Number(req.params.stashId), req.body, req.session.user);
|
const stash = await updateStash(Number(req.params.stashId), req.body, req.session.user);
|
||||||
|
|
||||||
await updateSessionUser(req);
|
|
||||||
|
|
||||||
res.send(stash);
|
res.send(stash);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function removeStashApi(req, res) {
|
export async function removeStashApi(req, res) {
|
||||||
await removeStash(Number(req.params.stashId), req.session.user);
|
await removeStash(Number(req.params.stashId), req.session.user);
|
||||||
await updateSessionUser(req);
|
|
||||||
|
|
||||||
res.status(204).send();
|
res.status(204).send();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue