Repository: usememos/memos
File: web/src/components/ShareMemoDialog.tsx (TypeScript)

Code before:
    URL.revokeObjectURL(url);
  };

  const handleCopyLinkBtnClick = () => {
    copy(`${window.location.origin}/m/${memo.name}`);
    if (memo.visibility !== Visibility.PUBLIC) {
      toast.success(t("message.succeed-copy-link-not-public"));
    } else {
      toast.success(t("message.succeed-copy-link"));
    }
  };

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

  if (loadingState.isLoading) {
    return null;
  }

  return (
    <>
      <div className="dialog-header-container py-3 px-4 !mb-0 rounded-t-lg">
        <p className="">{t("common.share")} Memo</p>
        <IconButton size="sm" onClick={handleCloseBtnClick}>
          <Icon.X className="w-5 h-auto" />
        </IconButton>
      </div>
      <div className="dialog-content-container w-full flex flex-col justify-start items-start relative">
        <div className="px-4 pb-3 w-full flex flex-row justify-between items-center space-x-2">
          <div className="flex flex-row justify-start items-center space-x-2">
            <Button color="neutral" variant="outlined" disabled={downloadingImageState.isLoading} onClick={handleDownloadImageBtnClick}>
              {downloadingImageState.isLoading ? (
                <Icon.Loader className="w-4 h-auto mr-1 animate-spin" />
              ) : (
                <Icon.Download className="w-4 h-auto mr-1" />
              )}
              {t("common.image")}
            </Button>

Review comment (suggestion):
Don't need to use `then` in `async/await` function.

```suggestion
    const updatedMemo = await memoStore
      .updateMemo(
        {
          id: memo.id,
          visibility: visibility,
        },
        ["visibility"],
      )
      .then((newMemo: Memo) => {
        if (newMemo.visibility == visibility) {
          toast.success(t("common.changed"));
        }
      });
```

Code after:
    URL.revokeObjectURL(url);
  };

  const handleCopyLinkBtnClick = () => {
    copy(`${window.location.origin}/m/${memo.name}`);
    if (memo.visibility !== Visibility.PUBLIC) {
      toast.success(t("message.succeed-copy-link-not-public"));
    } else {
      toast.success(t("message.succeed-copy-link"));
    }
  };

  const handleMemoVisibilityOptionChanged = async (visibility: Visibility) => {
    const updatedMemo = await memoStore.updateMemo(
      {
        id: memo.id,
        visibility: visibility,
      },
      ["visibility"],
    );

    if (updatedMemo.visibility == visibility) {
      toast.success(t("common.changed"));
    }
  };

  if (loadingState.isLoading) {
    return null;
  }

  return (
    <>
      <div className="dialog-header-container py-3 px-4 !mb-0 rounded-t-lg">
        <p className="">{t("common.share")} Memo</p>
        <IconButton size="sm" onClick={handleCloseBtnClick}>
          <Icon.X className="w-5 h-auto" />
        </IconButton>
      </div>
      <div className="dialog-content-container w-full flex flex-col justify-start items-start relative">
        <div className="px-4 pb-3 w-full flex flex-row justify-between items-center space-x-2">
          <div className="flex flex-row justify-start items-center space-x-2">
            <Button color="neutral" variant="outlined" disabled={downloadingImageState.isLoading} onClick={handleDownloadImageBtnClick}>
              {downloadingImageState.isLoading ? (
                <Icon.Loader className="w-4 h-auto mr-1 animate-spin" />
              ) : (
                <Icon.Download className="w-4 h-auto mr-1" />
              )}
              {t("common.image")}
            </Button>
            <Button color="neutral" variant="outlined" onClick={handleDownloadTextFileBtnClick}>
              <Icon.File className="w-4 h-auto mr-1" />