Skip to content

Commit 8280463

Browse files
remove edit page for now
1 parent af6f154 commit 8280463

File tree

4 files changed

+27
-335
lines changed

4 files changed

+27
-335
lines changed

ultroid/app/plugins/edit/[id]/page.tsx

Lines changed: 0 additions & 309 deletions
This file was deleted.

ultroid/app/plugins/my-plugins/page.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22

3-
import { useState, useEffect } from 'react';
3+
import { useState, useEffect, useCallback } from 'react';
44
import { useShowPopup } from '@vkruglikov/react-telegram-web-app';
55
import { useRouter } from 'next/navigation';
66
import { pluginsApi, Plugin, api } from '@/utils/api';
@@ -13,7 +13,7 @@ export default function MyPlugins() {
1313
const [error, setError] = useState<string | null>(null);
1414
const [userId, setUserId] = useState<number | null>(null);
1515

16-
const loadMyPlugins = async () => {
16+
const loadMyPlugins = useCallback(async () => {
1717
try {
1818
setLoading(true);
1919

@@ -42,11 +42,11 @@ export default function MyPlugins() {
4242
} finally {
4343
setLoading(false);
4444
}
45-
};
45+
}, [showPopup]);
4646

4747
useEffect(() => {
4848
loadMyPlugins();
49-
}, []);
49+
}, [loadMyPlugins]);
5050

5151
const handleDeletePlugin = (plugin: Plugin) => {
5252
showPopup({
@@ -142,7 +142,7 @@ export default function MyPlugins() {
142142

143143
{plugins.length === 0 && !error && (
144144
<div className="text-center py-8 text-white/40">
145-
<p>You haven't uploaded any plugins yet</p>
145+
<p>You haven&apos;t uploaded any plugins yet</p>
146146
<button
147147
className="mt-4 px-4 py-2 bg-primary/20 text-primary rounded-lg hover:bg-primary/30 transition-colors"
148148
onClick={() => router.push('/plugins/upload')}

ultroid/app/plugins/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22

3-
import { useState, useEffect } from 'react';
3+
import { useState, useEffect, useCallback } from 'react';
44
import { useShowPopup } from '@vkruglikov/react-telegram-web-app';
55
import { useRouter } from 'next/navigation';
66
import { pluginsApi, Plugin } from '@/utils/api';
@@ -48,7 +48,7 @@ export default function PluginsStore() {
4848
const [loading, setLoading] = useState(true);
4949
const [error, setError] = useState<string | null>(null);
5050

51-
const loadPlugins = async () => {
51+
const loadPlugins = useCallback(async () => {
5252
try {
5353
setLoading(true);
5454
const data = await pluginsApi.listPlugins();
@@ -63,11 +63,11 @@ export default function PluginsStore() {
6363
} finally {
6464
setLoading(false);
6565
}
66-
};
66+
}, [showPopup]);
6767

6868
useEffect(() => {
6969
loadPlugins();
70-
}, []);
70+
}, [loadPlugins]);
7171

7272
const filteredPlugins = plugins.filter(plugin =>
7373
plugin.title.toLowerCase().includes(searchQuery.toLowerCase()) ||

0 commit comments

Comments
 (0)