lint fix
This commit is contained in:
@@ -14,6 +14,7 @@ import { Overlay } from "@ente/shared/components/Container";
|
||||
import { CustomError } from "@ente/shared/error";
|
||||
import useLongPress from "@ente/shared/hooks/useLongPress";
|
||||
import AlbumOutlined from "@mui/icons-material/AlbumOutlined";
|
||||
import Favorite from "@mui/icons-material/FavoriteRounded";
|
||||
import PlayCircleOutlineOutlinedIcon from "@mui/icons-material/PlayCircleOutlineOutlined";
|
||||
import { Tooltip, styled } from "@mui/material";
|
||||
import i18n from "i18next";
|
||||
@@ -23,7 +24,6 @@ import React, { useContext, useEffect, useRef, useState } from "react";
|
||||
import { TRASH_SECTION } from "utils/collection";
|
||||
import { shouldShowAvatar } from "utils/file";
|
||||
import Avatar from "./Avatar";
|
||||
import Favorite from "@mui/icons-material/FavoriteRounded";
|
||||
|
||||
interface IProps {
|
||||
file: EnteFile;
|
||||
@@ -363,7 +363,7 @@ export default function PreviewCard(props: IProps) {
|
||||
)}
|
||||
{props.isFav && (
|
||||
<FavOverlay>
|
||||
<Favorite/>
|
||||
<Favorite />
|
||||
</FavOverlay>
|
||||
)}
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@ import MoveIcon from "@mui/icons-material/ArrowForward";
|
||||
import CloseIcon from "@mui/icons-material/Close";
|
||||
import DeleteIcon from "@mui/icons-material/Delete";
|
||||
import DownloadIcon from "@mui/icons-material/Download";
|
||||
import FavoriteBorderIcon from "@mui/icons-material/FavoriteBorderRounded";
|
||||
import RemoveIcon from "@mui/icons-material/RemoveCircleOutline";
|
||||
import RestoreIcon from "@mui/icons-material/Restore";
|
||||
import UnArchiveIcon from "@mui/icons-material/Unarchive";
|
||||
import VisibilityOffOutlined from "@mui/icons-material/VisibilityOffOutlined";
|
||||
import VisibilityOutlined from "@mui/icons-material/VisibilityOutlined";
|
||||
import FavoriteBorderIcon from "@mui/icons-material/FavoriteBorderRounded";
|
||||
import { Box, IconButton, Stack, Tooltip } from "@mui/material";
|
||||
import { t } from "i18next";
|
||||
import { AppContext } from "pages/_app";
|
||||
@@ -336,7 +336,9 @@ const SelectedFileOptions = ({
|
||||
{!isFavoriteCollection && (
|
||||
<Tooltip title={t("favorites")}>
|
||||
<IconButton
|
||||
onClick={handleFileOps(FILE_OPS_TYPE.SET_FAVORITE)}
|
||||
onClick={handleFileOps(
|
||||
FILE_OPS_TYPE.SET_FAVORITE,
|
||||
)}
|
||||
>
|
||||
<FavoriteBorderIcon />
|
||||
</IconButton>
|
||||
|
||||
@@ -487,7 +487,7 @@ export const createFavoritesCollection = () => {
|
||||
|
||||
export const addToFavorites = async (file: EnteFile) => {
|
||||
await addMultipleToFavorites([file]);
|
||||
}
|
||||
};
|
||||
|
||||
export const addMultipleToFavorites = async (files: EnteFile[]) => {
|
||||
try {
|
||||
|
||||
@@ -24,7 +24,10 @@ import { LS_KEYS, getData } from "@ente/shared/storage/localStorage";
|
||||
import type { User } from "@ente/shared/user/types";
|
||||
import { downloadUsingAnchor } from "@ente/shared/utils";
|
||||
import { t } from "i18next";
|
||||
import { addMultipleToFavorites, moveToHiddenCollection } from "services/collectionService";
|
||||
import {
|
||||
addMultipleToFavorites,
|
||||
moveToHiddenCollection,
|
||||
} from "services/collectionService";
|
||||
import {
|
||||
deleteFromTrash,
|
||||
trashFiles,
|
||||
@@ -46,7 +49,7 @@ export enum FILE_OPS_TYPE {
|
||||
HIDE,
|
||||
TRASH,
|
||||
DELETE_PERMANENTLY,
|
||||
SET_FAVORITE
|
||||
SET_FAVORITE,
|
||||
}
|
||||
|
||||
export async function downloadFile(file: EnteFile) {
|
||||
@@ -633,7 +636,7 @@ export const handleFileOps = async (
|
||||
break;
|
||||
case FILE_OPS_TYPE.SET_FAVORITE:
|
||||
await setBulkFavorite(files);
|
||||
updateFavItemIds(new Set(files.map(f=>f.id)))
|
||||
updateFavItemIds(new Set(files.map((f) => f.id)));
|
||||
break;
|
||||
}
|
||||
};
|
||||
@@ -688,10 +691,10 @@ const fixTimeHelper = async (
|
||||
setFixCreationTimeAttributes({ files: selectedFiles });
|
||||
};
|
||||
|
||||
const setBulkFavorite = async (files: EnteFile []) => {
|
||||
const setBulkFavorite = async (files: EnteFile[]) => {
|
||||
try {
|
||||
await addMultipleToFavorites(files);
|
||||
} catch (e) {
|
||||
log.error("Could not add to favorites", e);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user