Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
proudparrot2 committed Feb 17, 2024
1 parent fab532c commit 71e7487
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function Navbar() {
)
})}
{loadedPlugins.map((item, i) => {
if (!item.page || !item.icon) return
if (!item.page || !item.icon || item.disabled) return
return (
<Tooltip key={i} delayDuration={0}>
<TooltipTrigger asChild>
Expand Down
3 changes: 1 addition & 2 deletions src/internal/Bookmarklets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ import { Star } from 'lucide-react'

const Bookmarklets: Plugin = {
name: 'Bookmarklets',
id: 'bunker.bookmarklets',
id: 'example.bookmarklets',
description: 'Store your bookmarklets in a convienent location',
icon: Star,


page() {
return <p className="w-screen">hi</p>
}
Expand Down
17 changes: 6 additions & 11 deletions src/lib/pluginloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,17 @@ function getSavedPlugins() {
}

export function togglePluginDisable(id: string) {
const plugins = $plugins.get();
const plugins = $plugins.get()

// Create a new array with the disabled property toggled for the matching id
const updatedPlugins = plugins.map(item => {
const updatedPlugins = plugins.map((item) => {
if (item.id === id) {
// Toggle the disabled property
return { ...item, disabled: !item.disabled };
return { ...item, disabled: !item.disabled }
} else {
// Return the original item
return item;
return item
}
});
})

// Update the store with the new array
$plugins.set(updatedPlugins);

$plugins.set(updatedPlugins)

if (store('disabledPlugins').includes(id)) {
var updated = store('disabledPlugins').filter(() => !store('disabledPlugins').includes(id))
Expand Down

0 comments on commit 71e7487

Please sign in to comment.