mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-24 18:02:47 +08:00
fix: add prefer-array-some rule (#5109)
This commit is contained in:
@@ -130,7 +130,7 @@ export const SettingModal = ({
|
||||
<WorkspaceSetting key={workspaceId} workspaceId={workspaceId} />
|
||||
</Suspense>
|
||||
) : null}
|
||||
{generalSettingList.find(v => v.key === activeTab) ? (
|
||||
{generalSettingList.some(v => v.key === activeTab) ? (
|
||||
<GeneralSetting generalKey={activeTab as GeneralSettingKeys} />
|
||||
) : null}
|
||||
{activeTab === 'account' && loginStatus === 'authenticated' ? (
|
||||
|
||||
@@ -57,9 +57,9 @@ const standardizeLocale = (language: string) => {
|
||||
} else if (language.slice(0, 2).toLowerCase() === 'zh') {
|
||||
language = 'zh-Hant';
|
||||
}
|
||||
if (LOCALES.find(locale => locale.tag === language)) return language;
|
||||
if (LOCALES.some(locale => locale.tag === language)) return language;
|
||||
if (
|
||||
LOCALES.find(locale => locale.tag === language.slice(0, 2).toLowerCase())
|
||||
LOCALES.some(locale => locale.tag === language.slice(0, 2).toLowerCase())
|
||||
) {
|
||||
return language.slice(0, 2).toLowerCase();
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ const ImagePreviewModalImpl = (
|
||||
if (
|
||||
page
|
||||
.getPreviousSiblings(block)
|
||||
.findLast(
|
||||
.some(
|
||||
(block): block is ImageBlockModel =>
|
||||
block.flavour === 'affine:image'
|
||||
)
|
||||
@@ -160,7 +160,7 @@ const ImagePreviewModalImpl = (
|
||||
} else if (
|
||||
page
|
||||
.getNextSiblings(block)
|
||||
.find(
|
||||
.some(
|
||||
(block): block is ImageBlockModel =>
|
||||
block.flavour === 'affine:image'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user