diff options
| author | Hazelnoot <acomputerdog@gmail.com> | 2025-05-29 16:56:24 -0400 |
|---|---|---|
| committer | Hazelnoot <acomputerdog@gmail.com> | 2025-05-30 12:35:31 -0400 |
| commit | 50a64f97df5c526a2f09e8e84e02347082b4954f (patch) | |
| tree | 3863799604cc645c04228eb472cbf9bd6e014a54 /packages/frontend/src/i.ts | |
| parent | merge: Log config file paths at startup (!1066) (diff) | |
| download | sharkey-50a64f97df5c526a2f09e8e84e02347082b4954f.tar.gz sharkey-50a64f97df5c526a2f09e8e84e02347082b4954f.tar.bz2 sharkey-50a64f97df5c526a2f09e8e84e02347082b4954f.zip | |
allow unauthenticated (logged-out) users to translate notes
Diffstat (limited to 'packages/frontend/src/i.ts')
| -rw-r--r-- | packages/frontend/src/i.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/frontend/src/i.ts b/packages/frontend/src/i.ts index a71ed1671f..996cec8b54 100644 --- a/packages/frontend/src/i.ts +++ b/packages/frontend/src/i.ts @@ -3,9 +3,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { reactive } from 'vue'; +import { computed, reactive } from 'vue'; import * as Misskey from 'misskey-js'; import { miLocalStorage } from '@/local-storage.js'; +import { fetchInstance } from '@/instance'; // TODO: 他のタブと永続化されたstateを同期 @@ -29,6 +30,10 @@ export function incNotesCount() { notesCount++; } +// instance export can be empty sometimes, which causes problems. +const instance = await fetchInstance(); +export const policies = computed<Misskey.entities.RolePolicies>(() => $i?.policies ?? instance.policies); + if (_DEV_) { (window as any).$i = $i; } |