修正用戶管理查詢失敗問題

This commit is contained in:
2025-08-05 11:55:29 +08:00
parent 65e9c411bf
commit 279720e276
3 changed files with 9 additions and 6 deletions

View File

@@ -171,7 +171,7 @@ export function AdminLayout({ children, currentPage, onPageChange }: AdminLayout
setShowLogoutDialog(false)
// Check if this is a popup/new tab opened from main site
if (window.opener && !window.opener.closed) {
if (typeof window !== 'undefined' && window.opener && !window.opener.closed) {
// If opened from another window, close this tab and focus parent
window.opener.focus()
window.close()
@@ -214,7 +214,7 @@ export function AdminLayout({ children, currentPage, onPageChange }: AdminLayout
<Button onClick={() => (window.location.href = "/")} variant="outline">
</Button>
{window.opener && !window.opener.closed && (
{typeof window !== 'undefined' && window.opener && !window.opener.closed && (
<Button
onClick={() => {
window.opener.focus()