mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-19 12:34:22 +08:00
合并冲突
This commit is contained in:
+2
-7
@@ -250,9 +250,7 @@ function MainContent(): React.JSX.Element {
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
const handleOAuthUserUpdated = (
|
||||
event: Event
|
||||
) => {
|
||||
const handleOAuthUserUpdated = (event: Event) => {
|
||||
const customEvent = event as CustomEvent<{
|
||||
user?: { name?: string } | null
|
||||
}>
|
||||
@@ -267,10 +265,7 @@ function MainContent(): React.JSX.Element {
|
||||
|
||||
window.addEventListener("ss:oauth-user-updated", handleOAuthUserUpdated as EventListener)
|
||||
return () => {
|
||||
window.removeEventListener(
|
||||
"ss:oauth-user-updated",
|
||||
handleOAuthUserUpdated as EventListener
|
||||
)
|
||||
window.removeEventListener("ss:oauth-user-updated", handleOAuthUserUpdated as EventListener)
|
||||
}
|
||||
}, [refreshPermissionFromAuth])
|
||||
|
||||
|
||||
@@ -1108,9 +1108,7 @@ ORDER BY reward_points DESC, score DESC`,
|
||||
fontSize: 28,
|
||||
lineHeight: 1,
|
||||
color:
|
||||
primaryMetric && primaryMetric.value >= 0
|
||||
? "#52c41a"
|
||||
: "#ff4d4f",
|
||||
primaryMetric && primaryMetric.value >= 0 ? "#52c41a" : "#ff4d4f",
|
||||
background: "rgba(255,255,255,0.62)",
|
||||
border: "1px solid rgba(255,255,255,0.82)",
|
||||
borderRadius: 8,
|
||||
|
||||
@@ -371,7 +371,9 @@ export function ContentArea({
|
||||
}}
|
||||
>
|
||||
<div style={{ fontSize: "12px", color: "var(--ss-text-secondary)" }}>最近同步时间</div>
|
||||
<div style={{ fontSize: "12px", color: "var(--ss-text-main)" }}>{formattedLastSyncTime}</div>
|
||||
<div style={{ fontSize: "12px", color: "var(--ss-text-main)" }}>
|
||||
{formattedLastSyncTime}
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ fontSize: "13px", color: "var(--ss-text-secondary)" }}>云空间用量</div>
|
||||
{storageUsageLoading ? (
|
||||
|
||||
+20
-8
@@ -13,7 +13,13 @@ import {
|
||||
Divider,
|
||||
Dropdown,
|
||||
} from "antd"
|
||||
import { SearchOutlined, DeleteOutlined, UndoOutlined, UploadOutlined, CopyOutlined } from "@ant-design/icons"
|
||||
import {
|
||||
SearchOutlined,
|
||||
DeleteOutlined,
|
||||
UndoOutlined,
|
||||
UploadOutlined,
|
||||
CopyOutlined,
|
||||
} from "@ant-design/icons"
|
||||
import { useTranslation } from "react-i18next"
|
||||
import { match, pinyin } from "pinyin-pro"
|
||||
import { getAvatarFromExtraJson, setAvatarInExtraJson } from "../utils/studentAvatar"
|
||||
@@ -651,7 +657,8 @@ export const Home: React.FC<HomeProps> = ({
|
||||
setOperationVisible(true)
|
||||
}
|
||||
|
||||
const playOperationMorph = useCallback((attempt = 0) => {
|
||||
const playOperationMorph = useCallback(
|
||||
(attempt = 0) => {
|
||||
if (isPortraitMode || !operationOriginRect) return false
|
||||
const modalEl = document.querySelector(`.${operationModalClass}`) as HTMLElement | null
|
||||
if (!modalEl) {
|
||||
@@ -677,9 +684,9 @@ export const Home: React.FC<HomeProps> = ({
|
||||
modalEl.style.transform = ""
|
||||
modalEl.style.opacity = ""
|
||||
modalEl.style.visibility = ""
|
||||
const maskEl = document.querySelector(`.${operationModalRootClass} .ant-modal-mask`) as
|
||||
| HTMLElement
|
||||
| null
|
||||
const maskEl = document.querySelector(
|
||||
`.${operationModalRootClass} .ant-modal-mask`
|
||||
) as HTMLElement | null
|
||||
if (maskEl) {
|
||||
operationMaskAnimationRef.current?.cancel()
|
||||
maskEl.style.opacity = ""
|
||||
@@ -755,7 +762,9 @@ export const Home: React.FC<HomeProps> = ({
|
||||
logHome("operation:morph:animation-cancel")
|
||||
}
|
||||
return true
|
||||
}, [isPortraitMode, operationOriginRect, operationModalClass, operationModalRootClass])
|
||||
},
|
||||
[isPortraitMode, operationOriginRect, operationModalClass, operationModalRootClass]
|
||||
)
|
||||
|
||||
useLayoutEffect(() => {
|
||||
if (isPortraitMode || !operationVisible) return
|
||||
@@ -787,7 +796,8 @@ export const Home: React.FC<HomeProps> = ({
|
||||
}
|
||||
}, [isPortraitMode, operationVisible, operationOriginRect, playOperationMorph])
|
||||
|
||||
const finishCloseOperationModal = useCallback((skipCancelMorph = false, skipCancelMask = false) => {
|
||||
const finishCloseOperationModal = useCallback(
|
||||
(skipCancelMorph = false, skipCancelMask = false) => {
|
||||
if (!skipCancelMorph) {
|
||||
operationMorphAnimationRef.current?.cancel()
|
||||
}
|
||||
@@ -803,7 +813,9 @@ export const Home: React.FC<HomeProps> = ({
|
||||
operationClosingRef.current = false
|
||||
setOperationVisible(false)
|
||||
setOperationOriginRect(null)
|
||||
}, [])
|
||||
},
|
||||
[]
|
||||
)
|
||||
|
||||
const closeOperationModal = useCallback(() => {
|
||||
logHome("operation:morph:close", {
|
||||
|
||||
@@ -120,7 +120,9 @@ export const RewardExchange: React.FC<{ canEdit: boolean }> = ({ canEdit }) => {
|
||||
}
|
||||
|
||||
const frame = window.requestAnimationFrame(() => {
|
||||
const modalEl = document.querySelector(".ss-reward-morph-modal.ant-modal") as HTMLElement | null
|
||||
const modalEl = document.querySelector(
|
||||
".ss-reward-morph-modal.ant-modal"
|
||||
) as HTMLElement | null
|
||||
if (!modalEl) {
|
||||
setModalMorphStage("idle")
|
||||
return
|
||||
|
||||
@@ -416,15 +416,13 @@ export const Settings: React.FC<{
|
||||
useEffect(() => {
|
||||
const handleOAuthUserUpdated = (event: Event) => {
|
||||
const customEvent = event as CustomEvent<{
|
||||
user?:
|
||||
| {
|
||||
user?: {
|
||||
user_id?: string
|
||||
email?: string
|
||||
name?: string
|
||||
github_username?: string
|
||||
permission?: number
|
||||
}
|
||||
| null
|
||||
} | null
|
||||
}>
|
||||
const user = customEvent?.detail?.user
|
||||
if (user?.user_id && user.email && user.name && typeof user.permission === "number") {
|
||||
@@ -442,10 +440,7 @@ export const Settings: React.FC<{
|
||||
|
||||
window.addEventListener("ss:oauth-user-updated", handleOAuthUserUpdated as EventListener)
|
||||
return () => {
|
||||
window.removeEventListener(
|
||||
"ss:oauth-user-updated",
|
||||
handleOAuthUserUpdated as EventListener
|
||||
)
|
||||
window.removeEventListener("ss:oauth-user-updated", handleOAuthUserUpdated as EventListener)
|
||||
}
|
||||
}, [])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user