always go to tag page from widget #264

This commit is contained in:
dakkar 2023-12-29 14:54:01 +00:00
parent 2e55c292bf
commit cd8ba4b634

View file

@ -23,8 +23,6 @@ import { i18n } from '@/i18n.js';
import * as os from '@/os.js'; import * as os from '@/os.js';
import { useRouter } from '@/router.js'; import { useRouter } from '@/router.js';
import { GetFormResultType } from '@/scripts/form.js'; import { GetFormResultType } from '@/scripts/form.js';
import { $i } from '@/account.js';
import { instance } from '@/instance.js';
const name = 'search'; const name = 'search';
@ -62,7 +60,6 @@ let notePagination = ref();
let isLocalOnly = ref(false); let isLocalOnly = ref(false);
let order = ref(true); let order = ref(true);
let filetype = ref<null | string>(null); let filetype = ref<null | string>(null);
const notesSearchAvailable = (($i == null && instance.policies.canSearchNotes) || ($i != null && $i.policies.canSearchNotes));
function options(ev) { function options(ev) {
os.popupMenu([{ os.popupMenu([{
@ -125,14 +122,11 @@ async function search() {
return; return;
} }
if (!notesSearchAvailable && query.startsWith('#')) { if (query.startsWith('#')) {
// can't really search, at least try handling hashtags
router.push(`/tags/${encodeURIComponent(query.substring(1))}`); router.push(`/tags/${encodeURIComponent(query.substring(1))}`);
return; return;
} }
// TODO: if !notesSearchAvailable pop up an error message
notePagination.value = { notePagination.value = {
endpoint: 'notes/search', endpoint: 'notes/search',
limit: 10, limit: 10,