알림삭제 오류 수정
This commit is contained in:
@@ -1927,7 +1927,7 @@ function App() {
|
||||
markets={monitoredMarkets}
|
||||
marketSubscriptions={liveStompSubscriptions}
|
||||
activeMarket={symbol}
|
||||
enabled={formalLogin && monitoredMarkets.length > 0}
|
||||
enabled={formalLogin && monitoredMarkets.length > 0 && appSettingsLoaded}
|
||||
popupEnabled={appDefaults.tradeAlertPopup ?? true}
|
||||
chartMarkersActive={menuPage === 'chart'}
|
||||
onMarkersChange={markers => {
|
||||
|
||||
@@ -79,6 +79,14 @@ export function getAppSettingsCache(): AppSettingsDto {
|
||||
return _cache ?? {};
|
||||
}
|
||||
|
||||
/** 낙관적 캐시 패치 — _cache 가 null 일 때도 다음 로드 전까지 임시 보관 */
|
||||
export function patchAppSettingsCache(patch: Partial<AppSettingsDto>): void {
|
||||
if (_cache !== null) {
|
||||
Object.assign(_cache, patch);
|
||||
}
|
||||
// _cache 가 null 이면 현재 로드 중이므로 건너뜀 (로드 완료 후 DB 저장값으로 덮어씌워짐)
|
||||
}
|
||||
|
||||
export function subscribeAppSettings(listener: AppSettingsListener): () => void {
|
||||
_listeners.add(listener);
|
||||
return () => _listeners.delete(listener);
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
*/
|
||||
import {
|
||||
getAppSettingsCache,
|
||||
patchAppSettingsCache,
|
||||
subscribeAppSettings,
|
||||
} from '../hooks/useAppSettings';
|
||||
import { saveAppSettings, type AppSettingsDto } from './backendApi';
|
||||
import { saveAppSettings } from './backendApi';
|
||||
import {
|
||||
EMPTY_UI_PREFERENCES,
|
||||
UI_PREFERENCES_VERSION,
|
||||
@@ -64,9 +65,7 @@ export function patchUiPreferences(patch: Partial<UiPreferences>, immediate = fa
|
||||
const next = deepMerge(current as Record<string, unknown>, patch as Record<string, unknown>) as UiPreferences;
|
||||
next.v = UI_PREFERENCES_VERSION;
|
||||
|
||||
const cache = getAppSettingsCache();
|
||||
const merged: AppSettingsDto = { ...cache, uiPreferences: next };
|
||||
Object.assign(cache, merged);
|
||||
patchAppSettingsCache({ uiPreferences: next });
|
||||
|
||||
pendingPatch = pendingPatch
|
||||
? (deepMerge(pendingPatch as Record<string, unknown>, patch as Record<string, unknown>) as Partial<UiPreferences>)
|
||||
|
||||
Reference in New Issue
Block a user