forked from FoundKeyGang/FoundKey
client: fix issue of search only working once
closes FoundKeyGang/FoundKey#274 Changelog: Fixed
This commit is contained in:
parent
b66f7550ab
commit
501cf834c8
1 changed files with 37 additions and 30 deletions
|
@ -55,7 +55,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, watch } from 'vue';
|
||||
import { computed, nextTick, watch } from 'vue';
|
||||
import XNotes from '@/components/notes.vue';
|
||||
import XUserList from '@/components/user-list.vue';
|
||||
import MkButton from '@/components/ui/button.vue';
|
||||
|
@ -115,6 +115,9 @@ function selectUser() {
|
|||
}
|
||||
|
||||
async function search(): void {
|
||||
userPagination = null;
|
||||
notePagination = null;
|
||||
|
||||
switch (tab) {
|
||||
case 'all': {
|
||||
query = query.trim();
|
||||
|
@ -138,6 +141,7 @@ async function search(): void {
|
|||
mainRouter.push(`/notes/${res.object.id}`);
|
||||
}
|
||||
} else {
|
||||
nextTick(() => {
|
||||
notePagination = {
|
||||
endpoint: 'notes/search' as const,
|
||||
limit: 10,
|
||||
|
@ -152,6 +156,7 @@ async function search(): void {
|
|||
origin,
|
||||
},
|
||||
};
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -171,16 +176,17 @@ async function search(): void {
|
|||
params.host = host;
|
||||
break;
|
||||
}
|
||||
nextTick(() => {
|
||||
notePagination = {
|
||||
endpoint: 'notes/search' as const,
|
||||
limit: 10,
|
||||
params,
|
||||
};
|
||||
userPagination = null;
|
||||
});
|
||||
break;
|
||||
}
|
||||
case 'users': {
|
||||
notePagination = null;
|
||||
nextTick(() => {
|
||||
userPagination = {
|
||||
endpoint: 'users/search' as const,
|
||||
limit: 10,
|
||||
|
@ -189,6 +195,7 @@ async function search(): void {
|
|||
origin,
|
||||
},
|
||||
};
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue