mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-01 03:56:38 +08:00
优化
优化
This commit is contained in:
@@ -29,7 +29,7 @@ export interface ExternalPlayer {
|
||||
|
||||
function publicOriginHeader() {
|
||||
if (typeof window === 'undefined' || !window.location?.origin) return undefined
|
||||
return { 'X-MediaStation-Public-Origin': window.location.origin }
|
||||
return { 'X-MMTL-Public-Origin': window.location.origin }
|
||||
}
|
||||
|
||||
export const playbackAPI = {
|
||||
|
||||
@@ -3,12 +3,13 @@ import { useCallback, useEffect, useState } from 'react'
|
||||
export type ThemeMode = 'light' | 'dark' | 'system'
|
||||
export type ResolvedTheme = 'light' | 'dark'
|
||||
|
||||
const THEME_STORAGE_KEY = 'mediastationgo.theme'
|
||||
const THEME_STORAGE_KEY = 'mmtl.theme'
|
||||
const THEME_LEGACY_STORAGE_KEY = 'mediastationgo.theme'
|
||||
const DARK_QUERY = '(prefers-color-scheme: dark)'
|
||||
|
||||
function readStoredTheme(): ThemeMode {
|
||||
if (typeof window === 'undefined') return 'system'
|
||||
const value = window.localStorage.getItem(THEME_STORAGE_KEY)
|
||||
const value = window.localStorage.getItem(THEME_STORAGE_KEY) || window.localStorage.getItem(THEME_LEGACY_STORAGE_KEY)
|
||||
return value === 'light' || value === 'dark' || value === 'system' ? value : 'system'
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ export const useAuthStore = create<AuthState>()(
|
||||
},
|
||||
}),
|
||||
{
|
||||
name: 'mediastationgo-auth',
|
||||
name: 'mmtl-auth',
|
||||
partialize: (state) => ({
|
||||
token: state.token,
|
||||
refreshToken: state.refreshToken,
|
||||
|
||||
@@ -22,7 +22,7 @@ export const usePlayProfileStore = create<PlayProfileState>()(
|
||||
})),
|
||||
}),
|
||||
{
|
||||
name: 'mediastationgo-play-profile',
|
||||
name: 'mmtl-play-profile',
|
||||
storage: createJSONStorage(() => sessionStorage),
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user