nicolium: more rename stuff
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
@@ -9,7 +9,7 @@ import { useSettingsStore } from '@/stores/settings';
|
||||
import { getAuthUserId, getAuthUserUrl } from '@/utils/auth';
|
||||
|
||||
import { loadCredentials } from './auth';
|
||||
import { FE_NAME } from './settings';
|
||||
import { FE_NAME, LEGACY_FE_NAME } from './settings';
|
||||
|
||||
import type { AppDispatch, RootState } from '@/store';
|
||||
import type { CredentialAccount, UpdateCredentialsParams } from 'pl-api';
|
||||
@@ -89,7 +89,11 @@ const patchMe =
|
||||
const fetchMeSuccess = (account: CredentialAccount) => {
|
||||
setSentryAccount(account);
|
||||
|
||||
useSettingsStore.getState().actions.loadUserSettings(account.settings_store?.[FE_NAME]);
|
||||
useSettingsStore
|
||||
.getState()
|
||||
.actions.loadUserSettings(
|
||||
account.settings_store?.[FE_NAME] || account.settings_store?.[LEGACY_FE_NAME],
|
||||
);
|
||||
useComposeStore.getState().actions.importDefaultSettings(account);
|
||||
|
||||
return {
|
||||
|
||||
@@ -12,7 +12,8 @@ import { isLoggedIn } from '@/utils/auth';
|
||||
|
||||
import type { AppDispatch, RootState } from '@/store';
|
||||
|
||||
const FE_NAME = NODE_ENV === 'production' ? 'pl_fe' : 'pl_fe_dev';
|
||||
const LEGACY_FE_NAME = NODE_ENV === 'production' ? 'pl_fe' : 'pl_fe_dev';
|
||||
const FE_NAME = NODE_ENV === 'production' ? 'nicolium' : 'nicolium_dev';
|
||||
|
||||
/** Options when changing/saving settings. */
|
||||
type SettingOpts = {
|
||||
@@ -101,4 +102,4 @@ const getLocale = (fallback = 'en') => {
|
||||
: fallback;
|
||||
};
|
||||
|
||||
export { FE_NAME, changeSetting, saveSettings, updateSettingsStore, getLocale };
|
||||
export { FE_NAME, LEGACY_FE_NAME, changeSetting, saveSettings, updateSettingsStore, getLocale };
|
||||
|
||||
@@ -4,7 +4,7 @@ import { create } from 'zustand';
|
||||
import { mutative } from 'zustand-mutative';
|
||||
|
||||
import { uploadFile, updateMedia } from '@/actions/media';
|
||||
import { saveSettings } from '@/actions/settings';
|
||||
import { LEGACY_FE_NAME, saveSettings } from '@/actions/settings';
|
||||
import { FE_NAME } from '@/actions/settings';
|
||||
import { createStatus } from '@/actions/statuses';
|
||||
import { getClient } from '@/api';
|
||||
@@ -660,7 +660,8 @@ const useComposeStore = create<ComposeStore>()(
|
||||
|
||||
importDefaultSettings: (account) => {
|
||||
get().actions.updateCompose('default', (compose) => {
|
||||
const settings = account.settings_store?.[FE_NAME];
|
||||
const settings =
|
||||
account.settings_store?.[FE_NAME] || account.settings_store?.[LEGACY_FE_NAME];
|
||||
|
||||
if (!settings) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user