Skip to content

Commit

Permalink
fix(panel): fix data inconsistency
Browse files Browse the repository at this point in the history
  • Loading branch information
crimx committed May 15, 2018
1 parent 799cc4c commit 1b956aa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/content/components/DictPanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export interface DictPanelProps extends DictPanelDispatchers {
readonly isPinned: boolean
readonly dictionaries: DictionariesState['dictionaries']
readonly allDictsConfig: DictConfigs
readonly selectedDicts: DictID[]
readonly fontSize: number
readonly panelWidth: number
readonly isAnimation: boolean
Expand Down Expand Up @@ -69,15 +68,17 @@ export default class DictPanel extends React.Component<DictPanelProps> {
dictionaries,

allDictsConfig,
selectedDicts,
panelWidth,
fontSize,
isAnimation,

updateItemHeight,
} = this.props

const dictsInfo = dictionaries.dicts
const {
dicts: dictsInfo,
selected: selectedDicts,
} = dictionaries

// wrap iframe into DictPanel so that react
// can release memory correctly after removed from DOM
Expand Down
3 changes: 1 addition & 2 deletions src/content/components/DictPanelPortal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export type DictPanelPortalDispatchers = Omit<
export interface DictPanelPortalProps extends DictPanelPortalDispatchers {
readonly isAnimation: boolean
readonly allDictsConfig: DictConfigs
readonly selectedDicts: DictID[]
readonly fontSize: number

readonly isFav: boolean
Expand Down Expand Up @@ -129,8 +128,8 @@ export default class DictPanelPortal extends React.Component<DictPanelPortalProp
}

onFrameAnimationEnd = () => {
this.isAnimating = false
if (this.frame) {
this.isAnimating = false
// remove hardware acceleration to prevent blurry font
const iframeStyle = this.frame.style
const { x, y } = this.props.panelRect
Expand Down
1 change: 0 additions & 1 deletion src/content/containers/DictPanelContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export const mapStateToProps = ({
return {
isAnimation: config.animation,
allDictsConfig: config.dicts.all,
selectedDicts: config.dicts.selected,
fontSize: config.fontSize,

selection,
Expand Down

0 comments on commit 1b956aa

Please sign in to comment.