diff --git a/src/components/Apps/AppPublish.tsx b/src/components/Apps/AppPublish.tsx
index b1565b9..6ac7e76 100644
--- a/src/components/Apps/AppPublish.tsx
+++ b/src/components/Apps/AppPublish.tsx
@@ -25,6 +25,7 @@ import { CustomizedSnackbars } from '../Snackbar/Snackbar';
import { getFee } from '../../background';
import { fileToBase64 } from '../../utils/fileReading';
import { useTranslation } from 'react-i18next';
+import { useSortedMyNames } from '../../hooks/useSortedMyNames';
const CustomSelect = styled(Select)({
border: '0.5px solid var(--50-white, #FFFFFF80)',
@@ -148,7 +149,7 @@ export const AppPublish = ({ categories, myAddress, myName }) => {
try {
setIsLoading('Loading names');
const res = await fetch(
- `${getBaseApiReact()}/names/address/${myAddress}`
+ `${getBaseApiReact()}/names/address/${myAddress}?limit=0`
);
const data = await res.json();
setNames(data?.map((item) => item.name));
@@ -162,6 +163,8 @@ export const AppPublish = ({ categories, myAddress, myName }) => {
getNames();
}, [getNames]);
+ const mySortedNames = useSortedMyNames(names, myName);
+
const publishApp = async () => {
try {
const data = {
@@ -329,7 +332,7 @@ export const AppPublish = ({ categories, myAddress, myName }) => {
{/* This is the placeholder item */}
- {names.map((name) => {
+ {mySortedNames.map((name) => {
return {name};
})}
diff --git a/src/components/Apps/AppsDesktop.tsx b/src/components/Apps/AppsDesktop.tsx
index bca16cb..1cc6d0d 100644
--- a/src/components/Apps/AppsDesktop.tsx
+++ b/src/components/Apps/AppsDesktop.tsx
@@ -508,9 +508,9 @@ export const AppsDesktop = ({
{mode === 'publish' && !selectedTab && (
)}
diff --git a/src/components/Apps/AppsPrivate.tsx b/src/components/Apps/AppsPrivate.tsx
index 54f785c..a9f8d45 100644
--- a/src/components/Apps/AppsPrivate.tsx
+++ b/src/components/Apps/AppsPrivate.tsx
@@ -43,6 +43,7 @@ import { objectToBase64 } from '../../qdn/encryption/group-encryption';
import { getFee } from '../../background';
import { useAtom } from 'jotai';
import { useTranslation } from 'react-i18next';
+import { useSortedMyNames } from '../../hooks/useSortedMyNames';
const maxFileSize = 50 * 1024 * 1024; // 50MB
@@ -93,6 +94,8 @@ export const AppsPrivate = ({ myName, myAddress }) => {
name: '',
});
+ const mySortedNames = useSortedMyNames(names, myName);
+
const { getRootProps, getInputProps } = useDropzone({
accept: {
'application/zip': ['.zip'], // Only accept zip files
@@ -271,7 +274,7 @@ export const AppsPrivate = ({ myName, myAddress }) => {
if (!myAddress) return;
try {
const res = await fetch(
- `${getBaseApiReact()}/names/address/${myAddress}`
+ `${getBaseApiReact()}/names/address/${myAddress}?limit=0`
);
const data = await res.json();
setNames(data?.map((item) => item.name));
@@ -584,7 +587,7 @@ export const AppsPrivate = ({ myName, myAddress }) => {
onChange={(e) => setName(e.target.value)}
>
- {names.map((name) => {
+ {mySortedNames.map((name) => {
return (