mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-29 07:53:02 +00:00
alert when searching notes from widget, and search is disabled
This commit is contained in:
parent
bc02b4ae1f
commit
1b58326dd6
2 changed files with 9 additions and 7 deletions
|
@ -65,13 +65,6 @@ const props = defineProps<{
|
||||||
edit: boolean;
|
edit: boolean;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
// This will not be available for now as I don't think this is needed
|
|
||||||
// const notesSearchAvailable = (($i == null && instance.policies.canSearchNotes) || ($i != null && $i.policies.canSearchNotes));
|
|
||||||
/* if (!notesSearchAvailable) {
|
|
||||||
const wid = widgetDefs.findIndex(widget => widget === 'search');
|
|
||||||
widgetDefs.splice(wid, 1);
|
|
||||||
} */
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(ev: 'updateWidgets', widgets: Widget[]): void;
|
(ev: 'updateWidgets', widgets: Widget[]): void;
|
||||||
(ev: 'addWidget', widget: Widget): void;
|
(ev: 'addWidget', widget: Widget): void;
|
||||||
|
|
|
@ -24,6 +24,7 @@ import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
import { useRouter } from '@/router/supplier.js';
|
import { useRouter } from '@/router/supplier.js';
|
||||||
import { GetFormResultType } from '@/scripts/form.js';
|
import { GetFormResultType } from '@/scripts/form.js';
|
||||||
|
import { notesSearchAvailable } from '@/scripts/check-permissions.js';
|
||||||
|
|
||||||
const name = 'search';
|
const name = 'search';
|
||||||
|
|
||||||
|
@ -128,6 +129,14 @@ async function search() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!notesSearchAvailable) {
|
||||||
|
os.alert({
|
||||||
|
type: 'warning',
|
||||||
|
text: i18n.ts.notesSearchNotAvailable,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
notePagination.value = {
|
notePagination.value = {
|
||||||
endpoint: 'notes/search',
|
endpoint: 'notes/search',
|
||||||
limit: 10,
|
limit: 10,
|
||||||
|
|
Loading…
Reference in a new issue