🐛 Fix bugs

This commit is contained in:
2025-08-26 02:48:16 +08:00
parent aec01b117d
commit da4c4d3a84
2 changed files with 3 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
<template>
<div v-if="post" class="container max-w-5xl mx-auto mt-4">
<n-grid cols="1 l:5" responsive="screen" :x-gap="16">
<n-grid cols="1 l:5" responsive="screen" :x-gap="16" :y-gap="16">
<n-gi span="3">
<post-item :item="post" />
</n-gi>

View File

@@ -51,17 +51,15 @@ public class PostPageData(
.Include(e => e.Categories)
.FilterWithVisibility(currentUser, userFriends, userPublishers)
.FirstOrDefaultAsync();
if (post == null) return new Dictionary<string, object?>();
post = await ps.LoadPostInfo(post, currentUser);
// Track view - use the account ID as viewer ID if user is logged in
await ps.IncreaseViewCount(post.Id, currentUser?.Id);
var og = OpenGraph.MakeGraph(
title: post.Title ?? $"Post from {post.Publisher.Name}",
type: "article",
image: $"{_siteUrl}/cgi/drive/files/{post.Publisher.Background?.Id}?original=true",
url: $"{_siteUrl}/@{slug}",
description: post.Description ?? post.Content?[..80] ?? "Posted with some media",
description: post.Description ?? (post.Content?.Length > 80 ? post.Content?[..80] : post.Content) ?? "Posted with some media",
siteName: "Solar Network"
);