Skip to content

Commit

Permalink
update deprecated function
Browse files Browse the repository at this point in the history
  • Loading branch information
hipstersmoothie committed Sep 2, 2020
1 parent 5a745be commit 7221712
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Tool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,13 @@ export const DarkMode = ({ api }: DarkModeProps) => {
channel.on(STORY_CHANGED, renderTheme);
channel.on(SET_STORIES, renderTheme);
channel.on(DOCS_RENDERED, renderTheme);
prefersDark.addListener(prefersDarkUpdate);
prefersDark.addEventListener('change', prefersDarkUpdate);

return () => {
channel.removeListener(STORY_CHANGED, renderTheme);
channel.removeListener(SET_STORIES, renderTheme);
channel.removeListener(DOCS_RENDERED, renderTheme);
prefersDark.removeListener(prefersDarkUpdate);
prefersDark.removeEventListener('change', prefersDarkUpdate);
};
});

Expand Down

0 comments on commit 7221712

Please sign in to comment.