Persisting conversation pin statuses.
This commit is contained in:
parent
60b3032833
commit
264f97663e
|
@ -411,5 +411,7 @@
|
|||
"audioMessageAutoplayDescription": "Automatically play consecutively sent audio messages",
|
||||
"clickToTrustContact": "Click to download media",
|
||||
"trustThisContactDialogTitle": "Trust $name$?",
|
||||
"trustThisContactDialogDescription": "Are you sure you want to download media sent by $name$?"
|
||||
"trustThisContactDialogDescription": "Are you sure you want to download media sent by $name$?",
|
||||
"pinConversation": "Pin Conversation",
|
||||
"unpinConversation": "Unpin Conversation"
|
||||
}
|
||||
|
|
|
@ -141,8 +141,8 @@ export const MenuItemPinConversation = (props: PinConversationMenuItemProps): JS
|
|||
isPinned: !isPinned
|
||||
}))
|
||||
}
|
||||
|
||||
return <Item onClick={togglePinConversation}>{(isPinned ? 'Unpin' : 'Pin') + ' Conversation'}</Item>
|
||||
const menuText = isPinned ? window.i18n('unpinConversation'): window.i18n('pinConversation');
|
||||
return <Item onClick={togglePinConversation}>{menuText}</Item>
|
||||
}
|
||||
|
||||
export function getDeleteContactMenuItem(
|
||||
|
|
|
@ -6,7 +6,6 @@ import { persistReducer } from 'redux-persist';
|
|||
|
||||
// tslint:disable-next-line: no-submodule-imports match-default-export-name
|
||||
import storage from 'redux-persist/lib/storage';
|
||||
import purgeStoredState from 'redux-persist/es/purgeStoredState';
|
||||
|
||||
// @ts-ignore
|
||||
const env = window.getEnvironment();
|
||||
|
@ -30,7 +29,7 @@ const logger = createLogger({
|
|||
export const persistConfig = {
|
||||
key: 'root',
|
||||
storage,
|
||||
whitelist: ['userConfig', 'conversations'],
|
||||
whitelist: ['userConfig']
|
||||
};
|
||||
|
||||
const persistedReducer = persistReducer(persistConfig, allReducers);
|
||||
|
@ -41,7 +40,6 @@ const middlewareList = disableLogging ? [promise] : [promise, logger];
|
|||
|
||||
export const createStore = (initialState: any) =>
|
||||
configureStore({
|
||||
// reducer: allReducers,
|
||||
reducer: persistedReducer,
|
||||
preloadedState: initialState,
|
||||
middleware: (getDefaultMiddleware: any) => getDefaultMiddleware().concat(middlewareList),
|
||||
|
|
|
@ -14,6 +14,10 @@ import { defaultOnionReducer as onionPaths, OnionState } from './ducks/onion';
|
|||
import { modalReducer as modals, ModalState } from './ducks/modalDialog';
|
||||
import { userConfigReducer as userConfig, UserConfigState } from './ducks/userConfig';
|
||||
|
||||
// tslint:disable-next-line: no-submodule-imports match-default-export-name
|
||||
import storage from 'redux-persist/lib/storage';
|
||||
import persistReducer from 'redux-persist/lib/persistReducer';
|
||||
|
||||
export type StateType = {
|
||||
search: SearchStateType;
|
||||
user: UserStateType;
|
||||
|
@ -27,9 +31,15 @@ export type StateType = {
|
|||
userConfig: UserConfigState;
|
||||
};
|
||||
|
||||
const conversationsPersistConfig = {
|
||||
key: 'conversations',
|
||||
storage,
|
||||
whitelist: ['conversationLookup']
|
||||
}
|
||||
|
||||
export const reducers = {
|
||||
search,
|
||||
conversations,
|
||||
conversations: persistReducer(conversationsPersistConfig, conversations),
|
||||
user,
|
||||
theme,
|
||||
section,
|
||||
|
|
Loading…
Reference in New Issue