Add "Show New" option in plugin settings (#1416)

Co-authored-by: V <vendicated@riseup.net>
main
MrDiamondDog 1 year ago committed by GitHub
parent 8aea72c1be
commit 065ab75627
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -176,7 +176,8 @@ function PluginCard({ plugin, disabled, onRestartNeeded, onMouseEnter, onMouseLe
const enum SearchStatus { const enum SearchStatus {
ALL, ALL,
ENABLED, ENABLED,
DISABLED DISABLED,
NEW
} }
export default function PluginSettings() { export default function PluginSettings() {
@ -229,6 +230,7 @@ export default function PluginSettings() {
const enabled = settings.plugins[plugin.name]?.enabled; const enabled = settings.plugins[plugin.name]?.enabled;
if (enabled && searchValue.status === SearchStatus.DISABLED) return false; if (enabled && searchValue.status === SearchStatus.DISABLED) return false;
if (!enabled && searchValue.status === SearchStatus.ENABLED) return false; if (!enabled && searchValue.status === SearchStatus.ENABLED) return false;
if (searchValue.status === SearchStatus.NEW && !newPlugins?.includes(plugin.name)) return false;
if (!searchValue.value.length) return true; if (!searchValue.value.length) return true;
const v = searchValue.value.toLowerCase(); const v = searchValue.value.toLowerCase();
@ -321,7 +323,8 @@ export default function PluginSettings() {
options={[ options={[
{ label: "Show All", value: SearchStatus.ALL, default: true }, { label: "Show All", value: SearchStatus.ALL, default: true },
{ label: "Show Enabled", value: SearchStatus.ENABLED }, { label: "Show Enabled", value: SearchStatus.ENABLED },
{ label: "Show Disabled", value: SearchStatus.DISABLED } { label: "Show Disabled", value: SearchStatus.DISABLED },
{ label: "Show New", value: SearchStatus.NEW }
]} ]}
serialize={String} serialize={String}
select={onStatusChange} select={onStatusChange}

Loading…
Cancel
Save