Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking β€œSign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ”— feat: Enhance Share Functionality, Optimize DataTable & Fix Critical Bugs #5220

Merged
merged 18 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
77b9477
πŸ”„ refactor: frontend and backend share link logic; feat: qrcode for s…
berry-13 Jan 5, 2025
7720215
πŸ› fix: Conditionally render shared link and refactor share link creat…
berry-13 Jan 5, 2025
a9a3ec5
πŸ› fix: Correct conditional check for shareId in ShareButton component
berry-13 Jan 5, 2025
bb15103
πŸ”„ refactor: Update shared links API and data handling; improve query …
berry-13 Jan 6, 2025
8d40dc3
πŸ”„ refactor: Update shared links pagination and response structure; re…
berry-13 Jan 8, 2025
c009af8
πŸ”„ refactor: DataTable performance optimization
berry-13 Jan 11, 2025
63f6013
fix: delete shared link cache update
berry-13 Jan 12, 2025
d0c177f
πŸ”„ refactor: Enhance shared links functionality; add conversationId to…
berry-13 Jan 12, 2025
4e90f61
πŸ”„ refactor: Add delete functionality to SharedLinkButton; integrate d…
berry-13 Jan 12, 2025
3e82549
πŸ”„ feat: Add AnimatedSearchInput component with gradient animations an…
berry-13 Jan 15, 2025
098c155
πŸ”„ refactor: Improve SharedLinks component; enhance delete functionali…
berry-13 Jan 15, 2025
82fa32e
fix: mutation type issues with deleted shared link mutation
danny-avila Jan 20, 2025
08a92f7
fix: MutationOptions types
danny-avila Jan 20, 2025
f114756
fix: Ensure only public shared links are retrieved in getSharedLink f…
berry-13 Jan 20, 2025
1ecfaf3
fix: `qrcode.react` install location
danny-avila Jan 21, 2025
31aaff6
fix: ensure non-public shared links are not fetched when checking for…
danny-avila Jan 21, 2025
e61715d
fix: types and import order
danny-avila Jan 21, 2025
3c1d80b
refactor: cleanup share button UI logic, make more intuitive
danny-avila Jan 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
πŸ› fix: Conditionally render shared link and refactor share link creat…
…ion logic
  • Loading branch information
berry-13 authored and danny-avila committed Jan 21, 2025
commit 7720215e06e10034bdfb2890c2da2c0b8c84d63c
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ export default function ShareButton({
</div>
)}

<div className="cursor-text break-all text-center text-sm text-text-secondary">
{sharedLink}
</div>
{share?.shareId !=== undefined && (
<div className="cursor-text break-all text-center text-sm text-text-secondary">
{sharedLink}
</div>
)}
</div>
</div>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function SharedLinkButton({
const copyTimeoutRef = useRef<number | null>(null);
const shareId = share?.shareId || undefined;

const { mutate, isLoading: isCreateLoading } = useCreateSharedLinkMutation({
const { mutateAsync: mutate, isLoading: isCreateLoading } = useCreateSharedLinkMutation({
onError: () => {
showToast({
message: localize('com_ui_share_error'),
Expand Down Expand Up @@ -96,13 +96,27 @@ export default function SharedLinkButton({
}, 1500);
};

const createShareLink = async () => {
const share = await mutate({ conversationId });
const newLink = generateShareLink(share.shareId);
setSharedLink(newLink);

if (typeof copyTimeoutRef.current === 'number') {
clearTimeout(copyTimeoutRef.current);
}

setIsCopying(true);
copy(newLink);
copyTimeoutRef.current = window.setTimeout(() => {
setIsCopying(false);
}, 1500);
};

const getHandler = (shareId?: string) => {
if (shareId === undefined) {
return {
handler: async () => {
mutate({ conversationId });

setSharedLink(generateShareLink(shareId));
createShareLink();
},
label: (
<>
Expand Down