chore: fix various lint warnings

This commit is contained in:
plebeius
2025-12-26 17:30:55 +01:00
parent c9c9a8a78d
commit 756bff4b04
6 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ interface AuthorPrivilegesProps {
postCid?: string; postCid?: string;
} }
const useAuthorPrivileges = ({ commentAuthorAddress, subplebbitAddress, postCid }: AuthorPrivilegesProps) => { const useAuthorPrivileges = ({ commentAuthorAddress, subplebbitAddress }: AuthorPrivilegesProps) => {
const account = useAccount(); const account = useAccount();
const accountAuthorAddress = account?.author?.address; const accountAuthorAddress = account?.author?.address;
const subplebbit = useSubplebbitsStore((state) => state.subplebbits[subplebbitAddress]); const subplebbit = useSubplebbitsStore((state) => state.subplebbits[subplebbitAddress]);
+1 -1
View File
@@ -21,7 +21,7 @@ const useReplyModal = () => {
const getSelectedText = () => { const getSelectedText = () => {
let text = document.getSelection()?.toString(); let text = document.getSelection()?.toString();
text && setSelectedText(`>${text}\n`); if (text) setSelectedText(`>${text}\n`);
}; };
const openReplyModal = (parentCid: string, postCid: string, subplebbitAddress: string) => { const openReplyModal = (parentCid: string, postCid: string, subplebbitAddress: string) => {
+2 -2
View File
@@ -18,7 +18,7 @@ const getClientHost = (clientUrl: string): string => {
if (!clientHosts[clientUrl]) { if (!clientHosts[clientUrl]) {
try { try {
clientHosts[clientUrl] = new URL(clientUrl).hostname || clientUrl; clientHosts[clientUrl] = new URL(clientUrl).hostname || clientUrl;
} catch (e) { } catch {
clientHosts[clientUrl] = clientUrl; clientHosts[clientUrl] = clientUrl;
} }
} }
@@ -120,7 +120,7 @@ export const useFeedStateString = (subplebbitAddresses?: string[]): string | und
} }
// find all client urls // 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-ipns']?.clientUrls.forEach((clientUrl) => clientHosts.add(getClientHost(clientUrl)));
states['fetching-ipfs']?.clientUrls.forEach((clientUrl) => clientHosts.add(getClientHost(clientUrl))); states['fetching-ipfs']?.clientUrls.forEach((clientUrl) => clientHosts.add(getClientHost(clientUrl)));
+1 -1
View File
@@ -124,7 +124,7 @@ const useTimeFilter = () => {
} else if (timeFilterName) { } else if (timeFilterName) {
try { try {
timeFilterSeconds = convertTimeStringToSeconds(timeFilterName); timeFilterSeconds = convertTimeStringToSeconds(timeFilterName);
} catch (e) { } catch {
console.error(`Invalid time filter format: ${timeFilterName}`); console.error(`Invalid time filter format: ${timeFilterName}`);
timeFilterSeconds = undefined; timeFilterSeconds = undefined;
} }
+1 -1
View File
@@ -15,7 +15,7 @@ interface DisclaimerModalState {
const hasAcceptedDisclaimer = (): boolean => { const hasAcceptedDisclaimer = (): boolean => {
try { try {
return localStorage.getItem(DISCLAIMER_ACCEPTED_KEY) === 'true'; return localStorage.getItem(DISCLAIMER_ACCEPTED_KEY) === 'true';
} catch (error) { } catch {
return false; return false;
} }
}; };
+1 -1
View File
@@ -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 // Initialize with all directories visible by default
const allBoardCodes = getAllBoardCodes(); const allBoardCodes = getAllBoardCodes();
const defaultVisibleDirectories = new Set(allBoardCodes); const defaultVisibleDirectories = new Set(allBoardCodes);