refactor: more TS definitions
This commit is contained in:
@@ -37,7 +37,7 @@ const baseQuery = fetchBaseQuery({
|
||||
}
|
||||
});
|
||||
|
||||
let waitingForRenew = null;
|
||||
let waitingForRenew: null | any = null;
|
||||
const baseQueryWithTokenCheck = async (args, api, extraOptions) => {
|
||||
if (waitingForRenew) {
|
||||
await waitingForRenew;
|
||||
|
||||
Vendored
-10
@@ -61,13 +61,3 @@ declare module "*.module.css" {
|
||||
const classes: { readonly [key: string]: string };
|
||||
export default classes;
|
||||
}
|
||||
|
||||
declare module "*.module.scss" {
|
||||
const classes: { readonly [key: string]: string };
|
||||
export default classes;
|
||||
}
|
||||
|
||||
declare module "*.module.sass" {
|
||||
const classes: { readonly [key: string]: string };
|
||||
export default classes;
|
||||
}
|
||||
|
||||
@@ -26,11 +26,11 @@ export function getUnreadCount({ mids = [], messageData = {}, loginUid = 0, read
|
||||
return mid > readIndex;
|
||||
});
|
||||
// 拿at数量
|
||||
const tmps = [];
|
||||
const tmps: number[] = [];
|
||||
final.forEach((mid) => {
|
||||
const msg = messageData[mid];
|
||||
const { mentions = [] } = msg.properties || {};
|
||||
mentions.forEach((id) => {
|
||||
mentions.forEach((id: number) => {
|
||||
if (id == loginUid) {
|
||||
tmps.push(mid);
|
||||
}
|
||||
@@ -104,7 +104,6 @@ const StyledWrapper = styled.div`
|
||||
flex: 1;
|
||||
}
|
||||
&.select {
|
||||
/* cursor: pointer; */
|
||||
&:hover {
|
||||
border-radius: var(--br);
|
||||
background: #f5f6f7;
|
||||
@@ -127,7 +126,6 @@ const MessageWrapper = ({ selectMode = false, context, id, mid, children, ...res
|
||||
return (
|
||||
<StyledWrapper className={selectMode ? "select" : ""} {...rest}>
|
||||
<Checkbox className="check" checked={selected} />
|
||||
{/* {React.cloneElement(children, { readOnly: selected })} */}
|
||||
{children}
|
||||
{selectMode && <div className="overlay" onClick={selectMode ? toggleSelect : null}></div>}
|
||||
</StyledWrapper>
|
||||
|
||||
@@ -37,19 +37,18 @@ const Filters = [
|
||||
filter: "audio"
|
||||
}
|
||||
];
|
||||
type filter = "audio" | "video" | "image" | "";
|
||||
function FavsPage() {
|
||||
const [filter, setFilter] = useState("");
|
||||
const [filter, setFilter] = useState<filter>("");
|
||||
const [favs, setFavs] = useState([]);
|
||||
const { favorites, channelData, userData } = useAppSelector((store) => {
|
||||
console.log("favs", store.favorites);
|
||||
return {
|
||||
favorites: store.favorites,
|
||||
userData: store.users.byId,
|
||||
channelData: store.channels.byId
|
||||
};
|
||||
});
|
||||
const handleFilter = (ftr) => {
|
||||
console.log("fff", ftr);
|
||||
const handleFilter = (ftr: filter) => {
|
||||
setFilter(ftr);
|
||||
};
|
||||
useEffect(() => {
|
||||
@@ -122,7 +121,7 @@ function FavsPage() {
|
||||
<li
|
||||
key={f}
|
||||
className={`filter ${f == filter ? "active" : ""}`}
|
||||
onClick={handleFilter.bind(null, f)}
|
||||
onClick={handleFilter.bind(null, f as filter)}
|
||||
>
|
||||
{icon}
|
||||
<span className="txt">{title}</span>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// import React from 'react';
|
||||
import React from "react";
|
||||
import { RiAddFill } from "react-icons/ri";
|
||||
|
||||
import styled from "styled-components";
|
||||
@@ -60,7 +60,10 @@ const StyledWrapper = styled.div`
|
||||
}
|
||||
}
|
||||
`;
|
||||
export default function Tools({ expand = true }) {
|
||||
type Props = {
|
||||
expand?: boolean;
|
||||
};
|
||||
const Tools: React.FC<Props> = ({ expand = true }) => {
|
||||
return (
|
||||
<StyledWrapper>
|
||||
<hr />
|
||||
@@ -90,4 +93,5 @@ export default function Tools({ expand = true }) {
|
||||
</ul>
|
||||
</StyledWrapper>
|
||||
);
|
||||
}
|
||||
};
|
||||
export default Tools;
|
||||
|
||||
Reference in New Issue
Block a user