mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
chore: fix various lint warnings
This commit is contained in:
@@ -8,7 +8,7 @@ interface AuthorPrivilegesProps {
|
||||
postCid?: string;
|
||||
}
|
||||
|
||||
const useAuthorPrivileges = ({ commentAuthorAddress, subplebbitAddress, postCid }: AuthorPrivilegesProps) => {
|
||||
const useAuthorPrivileges = ({ commentAuthorAddress, subplebbitAddress }: AuthorPrivilegesProps) => {
|
||||
const account = useAccount();
|
||||
const accountAuthorAddress = account?.author?.address;
|
||||
const subplebbit = useSubplebbitsStore((state) => state.subplebbits[subplebbitAddress]);
|
||||
|
||||
@@ -21,7 +21,7 @@ const useReplyModal = () => {
|
||||
|
||||
const getSelectedText = () => {
|
||||
let text = document.getSelection()?.toString();
|
||||
text && setSelectedText(`>${text}\n`);
|
||||
if (text) setSelectedText(`>${text}\n`);
|
||||
};
|
||||
|
||||
const openReplyModal = (parentCid: string, postCid: string, subplebbitAddress: string) => {
|
||||
|
||||
@@ -18,7 +18,7 @@ const getClientHost = (clientUrl: string): string => {
|
||||
if (!clientHosts[clientUrl]) {
|
||||
try {
|
||||
clientHosts[clientUrl] = new URL(clientUrl).hostname || clientUrl;
|
||||
} catch (e) {
|
||||
} catch {
|
||||
clientHosts[clientUrl] = clientUrl;
|
||||
}
|
||||
}
|
||||
@@ -120,7 +120,7 @@ export const useFeedStateString = (subplebbitAddresses?: string[]): string | und
|
||||
}
|
||||
|
||||
// find all client urls
|
||||
const clientHosts = new Set([...pagesStatesClientHosts]);
|
||||
const clientHosts = new Set(pagesStatesClientHosts);
|
||||
states['fetching-ipns']?.clientUrls.forEach((clientUrl) => clientHosts.add(getClientHost(clientUrl)));
|
||||
states['fetching-ipfs']?.clientUrls.forEach((clientUrl) => clientHosts.add(getClientHost(clientUrl)));
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ const useTimeFilter = () => {
|
||||
} else if (timeFilterName) {
|
||||
try {
|
||||
timeFilterSeconds = convertTimeStringToSeconds(timeFilterName);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
console.error(`Invalid time filter format: ${timeFilterName}`);
|
||||
timeFilterSeconds = undefined;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ interface DisclaimerModalState {
|
||||
const hasAcceptedDisclaimer = (): boolean => {
|
||||
try {
|
||||
return localStorage.getItem(DISCLAIMER_ACCEPTED_KEY) === 'true';
|
||||
} catch (error) {
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -40,7 +40,7 @@ const saveToLocalStorage = (key: string, set: Set<string>) => {
|
||||
}
|
||||
};
|
||||
|
||||
const useTopbarVisibilityStore = create<TopbarVisibilityState>((set, get) => {
|
||||
const useTopbarVisibilityStore = create<TopbarVisibilityState>((set, _get) => {
|
||||
// Initialize with all directories visible by default
|
||||
const allBoardCodes = getAllBoardCodes();
|
||||
const defaultVisibleDirectories = new Set(allBoardCodes);
|
||||
|
||||
Reference in New Issue
Block a user