diff --git a/src/content/components/DictPanel/index.tsx b/src/content/components/DictPanel/index.tsx index 81b3bc5eb..758f998e7 100644 --- a/src/content/components/DictPanel/index.tsx +++ b/src/content/components/DictPanel/index.tsx @@ -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 @@ -69,7 +68,6 @@ export default class DictPanel extends React.Component { dictionaries, allDictsConfig, - selectedDicts, panelWidth, fontSize, isAnimation, @@ -77,7 +75,10 @@ export default class DictPanel extends React.Component { 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 diff --git a/src/content/components/DictPanelPortal/index.tsx b/src/content/components/DictPanelPortal/index.tsx index 169cd236d..da2213fd1 100644 --- a/src/content/components/DictPanelPortal/index.tsx +++ b/src/content/components/DictPanelPortal/index.tsx @@ -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 @@ -129,8 +128,8 @@ export default class DictPanelPortal extends React.Component { + 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 diff --git a/src/content/containers/DictPanelContainer.tsx b/src/content/containers/DictPanelContainer.tsx index 61b63ea64..5c1190a4e 100644 --- a/src/content/containers/DictPanelContainer.tsx +++ b/src/content/containers/DictPanelContainer.tsx @@ -19,7 +19,6 @@ export const mapStateToProps = ({ return { isAnimation: config.animation, allDictsConfig: config.dicts.all, - selectedDicts: config.dicts.selected, fontSize: config.fontSize, selection,