diff options
| author | Marie <github@yuugi.dev> | 2024-10-03 17:32:20 +0000 |
|---|---|---|
| committer | Marie <github@yuugi.dev> | 2024-10-03 17:32:20 +0000 |
| commit | 66ddf965b5a73065ac89c78fa16f854162e571b6 (patch) | |
| tree | d22fb16d9e18de095cc4e2c7afd091f9c7eb709c | |
| parent | merge: missing bubble timeline translations (!605) (diff) | |
| parent | alert when searching notes from widget, and search is disabled (diff) | |
| download | sharkey-66ddf965b5a73065ac89c78fa16f854162e571b6.tar.gz sharkey-66ddf965b5a73065ac89c78fa16f854162e571b6.tar.bz2 sharkey-66ddf965b5a73065ac89c78fa16f854162e571b6.zip | |
merge: alert when searching notes from widget, and search is disabled - fixes #275 (!629)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/629
Closes #275
Approved-by: fEmber <acomputerdog@gmail.com>
Approved-by: Marie <github@yuugi.dev>
| -rw-r--r-- | packages/frontend/src/components/MkWidgets.vue | 7 | ||||
| -rw-r--r-- | packages/frontend/src/widgets/WidgetSearch.vue | 9 |
2 files changed, 9 insertions, 7 deletions
diff --git a/packages/frontend/src/components/MkWidgets.vue b/packages/frontend/src/components/MkWidgets.vue index 06879f5917..7aed652811 100644 --- a/packages/frontend/src/components/MkWidgets.vue +++ b/packages/frontend/src/components/MkWidgets.vue @@ -65,13 +65,6 @@ const props = defineProps<{ 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<{ (ev: 'updateWidgets', widgets: Widget[]): void; (ev: 'addWidget', widget: Widget): void; diff --git a/packages/frontend/src/widgets/WidgetSearch.vue b/packages/frontend/src/widgets/WidgetSearch.vue index 294c97e293..9a0752c7f9 100644 --- a/packages/frontend/src/widgets/WidgetSearch.vue +++ b/packages/frontend/src/widgets/WidgetSearch.vue @@ -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, |