diff --git a/apps/desktop/resources/error.html b/apps/desktop/resources/error.html index 781aebb4f8..663f9cbc67 100644 --- a/apps/desktop/resources/error.html +++ b/apps/desktop/resources/error.html @@ -5,10 +5,18 @@ LobeHub - 连接错误 +
⚠️

Connection Error

diff --git a/apps/desktop/resources/splash.html b/apps/desktop/resources/splash.html index cb29472c32..5fd4cb9032 100644 --- a/apps/desktop/resources/splash.html +++ b/apps/desktop/resources/splash.html @@ -5,10 +5,18 @@ LobeHub +
(), + genericOAuthClient(), + magicLinkClient(), + ], + }); + } + return _client; +} + +function lazyProp(key: string): any { + // Target must be a function for the Proxy apply trap to work + return new Proxy(function () {}, { + apply(_t, thisArg, args) { + return Reflect.apply(getClient()[key], thisArg, args); + }, + get(_t, prop, receiver) { + const target = getClient()[key]; + const value = Reflect.get(target, prop, receiver); + return typeof value === 'function' ? value.bind(target) : value; + }, + }); +} + +export const changeEmail = lazyProp('changeEmail'); +export const linkSocial = lazyProp('linkSocial'); +export const oauth2 = lazyProp('oauth2'); +export const accountInfo = lazyProp('accountInfo'); +export const listAccounts = lazyProp('listAccounts'); +export const requestPasswordReset = lazyProp('requestPasswordReset'); +export const resetPassword = lazyProp('resetPassword'); +export const sendVerificationEmail = lazyProp('sendVerificationEmail'); +export const signIn = lazyProp('signIn'); +export const signOut = lazyProp('signOut'); +export const signUp = lazyProp('signUp'); +export const unlinkAccount = lazyProp('unlinkAccount'); +export const useSession = lazyProp('useSession'); diff --git a/src/routes/(main)/settings/profile/index.tsx b/src/routes/(main)/settings/profile/index.tsx index 57b1da744b..74a05c8442 100644 --- a/src/routes/(main)/settings/profile/index.tsx +++ b/src/routes/(main)/settings/profile/index.tsx @@ -131,7 +131,7 @@ const ProfileSetting = ({ mobile }: ProfileSettingProps) => { )} {/* SSO Providers Row */} - {isLogin && ( + {isLogin && !isDesktop && ( <>