🐛 Bug fixes

🐛 Fix cannot scan QR code from share post via image
This commit is contained in:
LittleSheep 2024-12-13 18:49:46 +08:00
parent 210c73a831
commit a3a0e8c7a2
8 changed files with 17 additions and 15 deletions

View File

@ -439,6 +439,7 @@
"userUnblocked": "{} has been unblocked.", "userUnblocked": "{} has been unblocked.",
"userBlocked": "{} has been blocked.", "userBlocked": "{} has been blocked.",
"postSharingViaPicture": "Capturing post as picture, please stand by...", "postSharingViaPicture": "Capturing post as picture, please stand by...",
"postImageShareReadMore": "Scan the QR code to read full post",
"postImageShareAds": "Explore posts on the Solar Network", "postImageShareAds": "Explore posts on the Solar Network",
"postShare": "Share", "postShare": "Share",
"postShareImage": "Share via Image" "postShareImage": "Share via Image"

View File

@ -437,6 +437,7 @@
"userUnblocked": "已解除屏蔽用户 {}", "userUnblocked": "已解除屏蔽用户 {}",
"userBlocked": "已屏蔽用户 {}", "userBlocked": "已屏蔽用户 {}",
"postSharingViaPicture": "正在生成帖子截图,请稍等片刻……", "postSharingViaPicture": "正在生成帖子截图,请稍等片刻……",
"postImageShareReadMore": "扫描坐车 QRCode 查看全文",
"postImageShareAds": "来 Solar Network 探索更多有趣帖子", "postImageShareAds": "来 Solar Network 探索更多有趣帖子",
"postShare": "分享", "postShare": "分享",
"postShareImage": "分享帖图" "postShareImage": "分享帖图"

View File

@ -437,6 +437,7 @@
"userUnblocked": "已解除屏蔽用户 {}", "userUnblocked": "已解除屏蔽用户 {}",
"userBlocked": "已屏蔽用户 {}", "userBlocked": "已屏蔽用户 {}",
"postSharingViaPicture": "正在生成帖子截圖,請稍等片刻……", "postSharingViaPicture": "正在生成帖子截圖,請稍等片刻……",
"postImageShareReadMore": "掃描坐車 QRCode 查看全文",
"postImageShareAds": "來 Solar Network 探索更多有趣帖子", "postImageShareAds": "來 Solar Network 探索更多有趣帖子",
"postShare": "分享", "postShare": "分享",
"postShareImage": "分享帖圖" "postShareImage": "分享帖圖"

View File

@ -437,6 +437,7 @@
"userUnblocked": "已解除遮蔽使用者 {}", "userUnblocked": "已解除遮蔽使用者 {}",
"userBlocked": "已遮蔽使用者 {}", "userBlocked": "已遮蔽使用者 {}",
"postSharingViaPicture": "正在生成帖子截圖,請稍等片刻……", "postSharingViaPicture": "正在生成帖子截圖,請稍等片刻……",
"postImageShareReadMore": "掃描坐車 QRCode 檢視全文",
"postImageShareAds": "來 Solar Network 探索更多有趣帖子", "postImageShareAds": "來 Solar Network 探索更多有趣帖子",
"postShare": "分享", "postShare": "分享",
"postShareImage": "分享帖圖" "postShareImage": "分享帖圖"

View File

@ -53,7 +53,7 @@ class SnPostContentProvider {
if (out.body['thumbnail'] != null) { if (out.body['thumbnail'] != null) {
rids.add(out.body['thumbnail']); rids.add(out.body['thumbnail']);
} }
if (out.repostId != null) { if (out.repostTo != null) {
out = out.copyWith( out = out.copyWith(
repostTo: await _preloadRelatedDataSingle(out.repostTo!), repostTo: await _preloadRelatedDataSingle(out.repostTo!),
); );

View File

@ -84,7 +84,7 @@ class PostItem extends StatelessWidget {
], ],
child: ResponsiveBreakpoints.builder( child: ResponsiveBreakpoints.builder(
breakpoints: ResponsiveBreakpoints.of(context).breakpoints, breakpoints: ResponsiveBreakpoints.of(context).breakpoints,
child: PostShareImage(data: data), child: PostShareImageWidget(data: data),
), ),
), ),
), ),
@ -115,7 +115,7 @@ class PostItem extends StatelessWidget {
final sn = context.read<SnNetworkProvider>(); final sn = context.read<SnNetworkProvider>();
final ua = context.read<UserProvider>(); final ua = context.read<UserProvider>();
final isAuthor = ua.isAuthorized && data.publisher.accountId == ua.user!.id; final isAuthor = ua.isAuthorized && data.publisher.accountId == ua.user?.id;
// Article headline preview // Article headline preview
if (!showFullPost && data.type == 'article') { if (!showFullPost && data.type == 'article') {
@ -261,8 +261,8 @@ class PostItem extends StatelessWidget {
} }
} }
class PostShareImage extends StatelessWidget { class PostShareImageWidget extends StatelessWidget {
const PostShareImage({ const PostShareImageWidget({
super.key, super.key,
required this.data, required this.data,
}); });
@ -349,6 +349,11 @@ class PostShareImage extends StatelessWidget {
], ],
), ),
), ),
if(data.body['content_truncated'] == true)
Text(
'postImageShareReadMore'.tr(),
style: GoogleFonts.robotoMono(fontSize: 11),
),
Text( Text(
'postImageShareAds', 'postImageShareAds',
style: GoogleFonts.robotoMono(fontSize: 13), style: GoogleFonts.robotoMono(fontSize: 13),
@ -359,15 +364,16 @@ class PostShareImage extends StatelessWidget {
QrImageView( QrImageView(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
data: 'https://solsynth.dev/posts/${data.id}', data: 'https://solsynth.dev/posts/${data.id}',
errorCorrectionLevel: QrErrorCorrectLevel.H,
version: QrVersions.auto, version: QrVersions.auto,
size: 100, size: 100,
gapless: true, gapless: true,
embeddedImage: AssetImage('assets/icon/icon-light-radius.png'), embeddedImage: AssetImage('assets/icon/icon-light-radius.png'),
embeddedImageStyle: QrEmbeddedImageStyle( embeddedImageStyle: QrEmbeddedImageStyle(
size: Size(32, 32), size: Size(24, 24),
), ),
eyeStyle: QrEyeStyle( eyeStyle: QrEyeStyle(
eyeShape: QrEyeShape.circle, eyeShape: QrEyeShape.square,
color: Theme.of(context).colorScheme.onSurface, color: Theme.of(context).colorScheme.onSurface,
), ),
dataModuleStyle: QrDataModuleStyle( dataModuleStyle: QrDataModuleStyle(

View File

@ -10,12 +10,8 @@
<true/> <true/>
<key>com.apple.security.device.audio-input</key> <key>com.apple.security.device.audio-input</key>
<true/> <true/>
<key>com.apple.security.device.bluetooth</key>
<true/>
<key>com.apple.security.device.camera</key> <key>com.apple.security.device.camera</key>
<true/> <true/>
<key>com.apple.security.files.downloads.read-write</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key> <key>com.apple.security.files.user-selected.read-write</key>
<true/> <true/>
<key>com.apple.security.network.client</key> <key>com.apple.security.network.client</key>

View File

@ -8,12 +8,8 @@
<true/> <true/>
<key>com.apple.security.device.audio-input</key> <key>com.apple.security.device.audio-input</key>
<true/> <true/>
<key>com.apple.security.device.bluetooth</key>
<true/>
<key>com.apple.security.device.camera</key> <key>com.apple.security.device.camera</key>
<true/> <true/>
<key>com.apple.security.files.downloads.read-write</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key> <key>com.apple.security.files.user-selected.read-write</key>
<true/> <true/>
<key>com.apple.security.network.client</key> <key>com.apple.security.network.client</key>