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: add visibility select in ShareMemoDialog #2941

Merged
merged 1 commit into from Feb 13, 2024
Merged

feat: add visibility select in ShareMemoDialog #2941

merged 1 commit into from Feb 13, 2024

Conversation

moehanabi
Copy link
Contributor

I am not familiar with ts/react coding, so please make a double check before merge.

In ShareMemoDialog, user can change the visibility of the memo, so that the memo can be set to public to be viewed by anyone with the link.

related issue: #2868
related pr: #2931

Comment on lines 86 to 98
await memoStore
.updateMemo(
{
id: memo.id,
visibility: visibility,
},
["visibility"],
)
.then((newMemo: Memo) => {
if (newMemo.visibility == visibility) {
toast.success(t("common.changed"));
}
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need to use then in async/await function.

Suggested change
await memoStore
.updateMemo(
{
id: memo.id,
visibility: visibility,
},
["visibility"],
)
.then((newMemo: Memo) => {
if (newMemo.visibility == visibility) {
toast.success(t("common.changed"));
}
});
const updatedMemo = await memoStore
.updateMemo(
{
id: memo.id,
visibility: visibility,
},
["visibility"],
)
.then((newMemo: Memo) => {
if (newMemo.visibility == visibility) {
toast.success(t("common.changed"));
}
});

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I force-pushed a new version, please check it.

Copy link
Collaborator

@boojack boojack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

In ShareMemoDialog, user can change the visibility
of the memo, so that the memo can be set to public
to be viewed by anyone with the link.
Copy link
Collaborator

@boojack boojack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@boojack boojack merged commit ebe3678 into usememos:main Feb 13, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants