diff --git a/manifest.json b/manifest.json index 0fd6853..8beb445 100644 --- a/manifest.json +++ b/manifest.json @@ -7,7 +7,7 @@ "discordID": "350227339784880130", "github": "griefmodz" }, - "version": "1.3.1", + "version": "1.3.2", "updater": { "type": "github", "id": "griefmodz/statistic-counter" diff --git a/package.json b/package.json index 3e1a98e..c04f6eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "statistic-counter", - "version": "1.3.1", + "version": "1.3.2", "description": "A Replugged plug-in that has been ported from Powercord which introduces an interchangeable statistic counter in-between the home button and servers list.", "engines": { "node": ">=14.0.0" @@ -31,7 +31,7 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-react": "^7.31.10", "prettier": "^2.8.1", - "replugged": "4.0.0-beta0.27", + "replugged": "4.0.0", "typescript": "^4.8.4" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c862d48..c031d06 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,7 +11,7 @@ specifiers: eslint-plugin-node: ^11.1.0 eslint-plugin-react: ^7.31.10 prettier: ^2.8.1 - replugged: 4.0.0-beta0.27 + replugged: 4.0.0 typescript: ^4.8.4 devDependencies: @@ -25,7 +25,7 @@ devDependencies: eslint-plugin-node: 11.1.0_eslint@8.32.0 eslint-plugin-react: 7.32.1_eslint@8.32.0 prettier: 2.8.3 - replugged: 4.0.0-beta0.27 + replugged: 4.0.0 typescript: 4.9.4 packages: @@ -3541,8 +3541,8 @@ packages: engines: {node: '>=8'} dev: true - /replugged/4.0.0-beta0.27: - resolution: {integrity: sha512-8ymTZNi3eBFVGug8HTG8QT/hodf9vh3ZcVFPTOfNlE2fxkPGYhAtfVSd+DU0nSxe+x/x41bwElqGi+a38OYPiw==} + /replugged/4.0.0: + resolution: {integrity: sha512-3wTTk1tK821RNku4mQsdKTbj/hpiNN8253pTELSJ3Jn3NZNXjVTugk7+ZmMGEfrHlxmRWADCwd62JvwZ2MvNMA==} engines: {node: '>=14.0.0'} hasBin: true dependencies: diff --git a/src/components/ContextMenu.tsx b/src/components/ContextMenu.tsx index 975a745..564206d 100644 --- a/src/components/ContextMenu.tsx +++ b/src/components/ContextMenu.tsx @@ -6,20 +6,25 @@ import { common, components, util, webpack } from 'replugged'; import { prefs } from '@index'; import CounterStore from '@lib/store'; +import ErrorBoundary from './ErrorBoundary'; const { React, fluxDispatcher } = common; const { ContextMenu } = components; const { Messages } = common.i18n; -const SliderControl = await webpack.waitForModule(webpack.filters.bySource('sliderContainer')); +const SliderControl = await webpack + .waitForModule(webpack.filters.bySource('sliderContainer,')) + .then((mod) => Object.values(mod).find((mod) => mod?.render?.toString?.().includes('sliderContainer'))); function CounterItems(): React.ReactElement[] { - return Object.keys(Counters).map((key) => { + const items: React.ReactElement[] = []; + + for (const key in Counters) { const counter = key as CounterType; const counterName = Messages[Counters[counter].translationKey]; const currentState = util.useSetting(prefs, counter); - return ( + items.push( ); - }); + } + + return items; } function VisibilityItems(): React.ReactElement { @@ -130,7 +137,9 @@ function ContextMenuItems(): React.ReactElement { } export default React.memo((props) => ( - - {ContextMenuItems()} - + + + {ContextMenuItems()} + + ));