alert when searching notes from widget, and search is disabled

This commit is contained in:
dakkar 2024-09-21 16:29:23 +01:00
parent bc02b4ae1f
commit 1b58326dd6
2 changed files with 9 additions and 7 deletions

View file

@ -24,6 +24,7 @@ import { misskeyApi } from '@/scripts/misskey-api.js';
import * as os from '@/os.js';
import { useRouter } from '@/router/supplier.js';
import { GetFormResultType } from '@/scripts/form.js';
import { notesSearchAvailable } from '@/scripts/check-permissions.js';
const name = 'search';
@ -128,6 +129,14 @@ async function search() {
return;
}
if (!notesSearchAvailable) {
os.alert({
type: 'warning',
text: i18n.ts.notesSearchNotAvailable,
});
return;
}
notePagination.value = {
endpoint: 'notes/search',
limit: 10,