Skip to content

Commit

Permalink
fix(panel): pin panel by default
Browse files Browse the repository at this point in the history
fix #1505
  • Loading branch information
crimx committed Oct 17, 2021
1 parent 169a14a commit e4ee931
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/content/redux/modules/action-handlers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ export const actionHandlers: ActionHandlers<State, ActionCatalog> = {
BOWL_ACTIVATED: state => ({
...state,
isShowBowl: false,
isShowDictPanel: true
isShowDictPanel: true,
isPinned: state.config.defaultPinned
}),

UPDATE_TEXT: (state, { payload }) => ({
Expand Down Expand Up @@ -112,6 +113,7 @@ export const actionHandlers: ActionHandlers<State, ActionCatalog> = {
? state
: {
...state,
isPinned: state.config.defaultPinned,
isShowDictPanel: true,
dictPanelCoord: {
x: payload.x,
Expand Down Expand Up @@ -220,6 +222,7 @@ export const actionHandlers: ActionHandlers<State, ActionCatalog> = {
...state,
text: payload,
historyIndex: 0,
isPinned: state.config.defaultPinned,
isShowDictPanel: true,
isShowBowl: false
}),
Expand Down
2 changes: 1 addition & 1 deletion src/content/redux/modules/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const initState = async () => {
activeProfile.mtaAutoUnfold === 'always' ||
(activeProfile.mtaAutoUnfold === 'popup' && isPopupPage())),
isExpandWaveformBox: false,
isPinned: config.defaultPinned,
isPinned: false,
/** Is current word in Notebook */
isFav: false,
bowlCoord: { x: 0, y: 0 },
Expand Down

0 comments on commit e4ee931

Please sign in to comment.