chore: wire release hook and service updates
This commit is contained in:
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
# Post-commit hook: 本地提交后自动执行 Web 预发布脚本。
|
||||
|
||||
set -eu
|
||||
|
||||
SCRIPT_PATH="scripts/release/pre_release_web.sh"
|
||||
|
||||
if [ "${COZSWEET_SKIP_POST_COMMIT_PRE_RELEASE:-}" = "1" ]; then
|
||||
echo "=== post-commit: skip pre-release hook (nested git operation) ==="
|
||||
exit 0
|
||||
fi
|
||||
|
||||
REPO_TOPLEVEL="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
|
||||
cd "$REPO_TOPLEVEL"
|
||||
|
||||
if [ ! -f "$SCRIPT_PATH" ]; then
|
||||
echo "=== post-commit: script not found: $SCRIPT_PATH ===" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "=== post-commit: running $SCRIPT_PATH ==="
|
||||
export COZSWEET_SKIP_POST_COMMIT_PRE_RELEASE=1
|
||||
bash "$SCRIPT_PATH"
|
||||
@@ -1,8 +1,10 @@
|
||||
"use client";
|
||||
|
||||
import { signOut } from "next-auth/react";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
import { MobileShell, SettingsSection } from "@/app/_components/core";
|
||||
import { ROUTES } from "@/router/routes";
|
||||
import { useAuthDispatch, useAuthState } from "@/stores/auth/auth-context";
|
||||
import { useUserDispatch, useUserState } from "@/stores/user/user-context";
|
||||
|
||||
@@ -29,6 +31,7 @@ const FALLBACK_USERNAME = "User name";
|
||||
* 原始 Dart: lib/ui/sidebar/sidebar_screen.dart + profile_view.dart
|
||||
*/
|
||||
export function SidebarScreen() {
|
||||
const router = useRouter();
|
||||
const user = useUserState();
|
||||
const userDispatch = useUserDispatch();
|
||||
const auth = useAuthState();
|
||||
@@ -59,7 +62,7 @@ export function SidebarScreen() {
|
||||
<div className={styles.shell}>
|
||||
<BackBar />
|
||||
|
||||
{/* 用户信息区:三种状态
|
||||
{/* 用户信息区:三种状态 */}
|
||||
<section className={styles.userSlot}>
|
||||
<UserHeader
|
||||
state={sidebarState}
|
||||
@@ -83,7 +86,7 @@ export function SidebarScreen() {
|
||||
totalMinutes={0}
|
||||
onBuyPackage={() => router.push(ROUTES.subscription)}
|
||||
/>
|
||||
</section> */}
|
||||
</section>
|
||||
|
||||
{sidebarState !== "guest" ? (
|
||||
<section className={styles.settingsSlot}>
|
||||
|
||||
@@ -6,22 +6,13 @@
|
||||
* / email / picture),把 pictureUrl 写入 `UserStorage.setAvatarUrl()`、
|
||||
* id 写入 `AuthStorage.setFacebookId()`。
|
||||
*
|
||||
* 为什么不依赖后端返回的 avatarUrl?
|
||||
* - 后端可能未抓取 / 未存头像
|
||||
* - 头像有时效性(用户改 Facebook 头像),前端直接拉最新的
|
||||
* - Facebook ID 也独立存一份(与后端 userId 解耦,给 deep link 用)
|
||||
*
|
||||
* 不引入 Facebook SDK(window.FB)—— 减少前端 bundle 体积,Graph API
|
||||
* 单次 HTTP 调用即可拿到所有字段。SDK 加载慢、还要管 init。
|
||||
*
|
||||
* 端点:`https://graph.facebook.com/me?fields=id,name,email,picture.type(large)&access_token=...`
|
||||
* - `picture.type(large)` 返回 ~200px 头像 URL(默认 square 50px 太小)
|
||||
* - 不指定 version 走最新稳定版
|
||||
* - 不需要 appId / appSecret(accessToken 自身就是凭证)
|
||||
*/
|
||||
import { FacebookUserData } from "@/data/dto/auth/facebook_user_data";
|
||||
import { Logger } from "./logger";
|
||||
import { Result, toError } from "./result";
|
||||
import { FacebookUserData } from "@/data/dto/auth";
|
||||
import { Logger, Result, toError } from "@/utils";
|
||||
|
||||
const log = new Logger("FacebookGraph");
|
||||
|
||||
@@ -10,6 +10,7 @@ export * from "./api/http_client";
|
||||
export * from "./api/metrics_api";
|
||||
export * from "./api/response_helper";
|
||||
export * from "./api/user_api";
|
||||
export * from "./facebook-graph";
|
||||
export * from "../../core/net/config/api_config";
|
||||
export * from "../../core/net/interceptor/auth_refresh_interceptor";
|
||||
export * from "../../core/net/interceptor/logging_interceptor";
|
||||
|
||||
@@ -7,9 +7,10 @@ import { AuthPlatform, type AuthProvider } from "@/lib/auth/auth_platform";
|
||||
import type { LoginStatus } from "@/data/dto/auth";
|
||||
import { authRepository } from "@/data/repositories/auth_repository";
|
||||
import type { IAuthRepository } from "@/data/repositories/interfaces";
|
||||
import { fetchFacebookUserData } from "@/data/services";
|
||||
import { AuthStorage } from "@/data/storage/auth/auth_storage";
|
||||
import { UserStorage } from "@/data/storage/user/user_storage";
|
||||
import { deviceIdentifier, fetchFacebookUserData, Logger, Result } from "@/utils";
|
||||
import { deviceIdentifier, Logger, Result } from "@/utils";
|
||||
|
||||
import { readGuestId } from "./auth-helpers";
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ export * from "./app-env";
|
||||
export * from "./browser-detect";
|
||||
export * from "./date";
|
||||
export * from "./device_identifier";
|
||||
export * from "./facebook-graph";
|
||||
export * from "./logger";
|
||||
export * from "./platform-detect";
|
||||
export * from "./pwa";
|
||||
|
||||
Reference in New Issue
Block a user