aboutsummaryrefslogtreecommitdiffstats
path: root/apps/browser-extension/src/components
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2025-11-23 11:21:22 +0000
committerGitHub <noreply@github.com>2025-11-23 11:21:22 +0000
commite4db9bf2725f1714f273332f0a444ec940aae1a8 (patch)
treec3960be69916673c06f78bf9d14fa5866316eea1 /apps/browser-extension/src/components
parent45081dcb472f6aa197d6ebdc129485f77fe3ee88 (diff)
downloadkarakeep-e4db9bf2725f1714f273332f0a444ec940aae1a8.tar.zst
fix: Hide shared lists where user is a viewer in Manage Lists dialog (#2164)
Users with viewer role cannot add/remove bookmarks from lists, so these lists should not appear in the Manage Lists dialog across all platforms (web, mobile, and extension). Changes: - Web: Updated BookmarkListSelector to filter out viewer lists - Mobile: Updated manage_lists.tsx to filter out viewer lists - Extension: Updated ListsSelector to filter out viewer lists Co-authored-by: Claude <noreply@anthropic.com>
Diffstat (limited to 'apps/browser-extension/src/components')
-rw-r--r--apps/browser-extension/src/components/ListsSelector.tsx50
1 files changed, 26 insertions, 24 deletions
diff --git a/apps/browser-extension/src/components/ListsSelector.tsx b/apps/browser-extension/src/components/ListsSelector.tsx
index 379338b6..86c151d1 100644
--- a/apps/browser-extension/src/components/ListsSelector.tsx
+++ b/apps/browser-extension/src/components/ListsSelector.tsx
@@ -74,31 +74,33 @@ export function ListsSelector({ bookmarkId }: { bookmarkId: string }) {
<CommandList>
<CommandEmpty>You don&apos;t have any lists.</CommandEmpty>
<CommandGroup>
- {allLists?.allPaths.map((path) => {
- const lastItem = path[path.length - 1];
+ {allLists?.allPaths
+ .filter((path) => path[path.length - 1].userRole !== "viewer")
+ .map((path) => {
+ const lastItem = path[path.length - 1];
- return (
- <CommandItem
- key={lastItem.id}
- value={lastItem.id}
- keywords={[lastItem.name, lastItem.icon]}
- onSelect={toggleList}
- disabled={currentlyUpdating.has(lastItem.id)}
- >
- <Check
- className={cn(
- "mr-2 size-4",
- existingListIds.has(lastItem.id)
- ? "opacity-100"
- : "opacity-0",
- )}
- />
- {path
- .map((item) => `${item.icon} ${item.name}`)
- .join(" / ")}
- </CommandItem>
- );
- })}
+ return (
+ <CommandItem
+ key={lastItem.id}
+ value={lastItem.id}
+ keywords={[lastItem.name, lastItem.icon]}
+ onSelect={toggleList}
+ disabled={currentlyUpdating.has(lastItem.id)}
+ >
+ <Check
+ className={cn(
+ "mr-2 size-4",
+ existingListIds.has(lastItem.id)
+ ? "opacity-100"
+ : "opacity-0",
+ )}
+ />
+ {path
+ .map((item) => `${item.icon} ${item.name}`)
+ .join(" / ")}
+ </CommandItem>
+ );
+ })}
</CommandGroup>
</CommandList>
</Command>