Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
remove unnecessary useCallback
Roman Pominov133f08c6f128
diff --git a/apps/designer/app/designer/features/sidebar-left/panels/pages/settings.tsx b/apps/designer/app/designer/features/sidebar-left/panels/pages/settings.tsxindex 35615ada89..47621703c0 100644--- a/apps/designer/app/designer/features/sidebar-left/panels/pages/settings.tsx+++ b/apps/designer/app/designer/features/sidebar-left/panels/pages/settings.tsx@@ -158,36 +158,33 @@ export const NewPageSettings = ({}) => {const [pages] = usePages();- const nameToPath = useCallback(- (name: string) => {- if (name === "") {- return "";- }+ const nameToPath = (name: string) => {+ if (name === "") {+ return "";+ }- const slug = slugify(name, { lower: true, strict: true });- const path = `/${slug}`;+ const slug = slugify(name, { lower: true, strict: true });+ const path = `/${slug}`;- // for TypeScript- if (pages === undefined) {- return path;- }+ // for TypeScript+ if (pages === undefined) {+ return path;+ }- if (projectUtils.pages.findByPath(pages, path) === undefined) {- return path;- }+ if (projectUtils.pages.findByPath(pages, path) === undefined) {+ return path;+ }- let suffix = 1;+ let suffix = 1;- while (- projectUtils.pages.findByPath(pages, `${path}${suffix}`) !== undefined- ) {- suffix++;- }+ while (+ projectUtils.pages.findByPath(pages, `${path}${suffix}`) !== undefined+ ) {+ suffix++;+ }- return `${path}${suffix}`;- },- [pages]- );+ return `${path}${suffix}`;+ };const fetcher = useFetcher<CreatePageData>();