Update meta to include feaures
This commit is contained in:
parent
adda2816c8
commit
1e48c89528
|
@ -523,10 +523,9 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||||
github: instance.enableGithubIntegration,
|
github: instance.enableGithubIntegration,
|
||||||
discord: instance.enableDiscordIntegration,
|
discord: instance.enableDiscordIntegration,
|
||||||
serviceWorker: instance.enableServiceWorker,
|
serviceWorker: instance.enableServiceWorker,
|
||||||
|
postEditing: instance.experimentalFeatures?.postEditing || false,
|
||||||
miauth: true,
|
miauth: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
response.experimentalFeatures = instance.experimentalFeatures;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
|
|
|
@ -304,7 +304,6 @@ export type LiteInstanceMetadata = {
|
||||||
url: string;
|
url: string;
|
||||||
imageUrl: string;
|
imageUrl: string;
|
||||||
}[];
|
}[];
|
||||||
experimentalFeatures?: Record<string, any>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type DetailedInstanceMetadata = LiteInstanceMetadata & {
|
export type DetailedInstanceMetadata = LiteInstanceMetadata & {
|
||||||
|
|
|
@ -8,7 +8,7 @@ const instanceData = localStorage.getItem("instance");
|
||||||
|
|
||||||
// TODO: instanceをリアクティブにするかは再考の余地あり
|
// TODO: instanceをリアクティブにするかは再考の余地あり
|
||||||
|
|
||||||
export const instance: Misskey.entities.InstanceMetadata = reactive(
|
export const instance: Misskey.entities.DetailedInstanceMetadata = reactive(
|
||||||
instanceData
|
instanceData
|
||||||
? JSON.parse(instanceData)
|
? JSON.parse(instanceData)
|
||||||
: {
|
: {
|
||||||
|
@ -18,7 +18,7 @@ export const instance: Misskey.entities.InstanceMetadata = reactive(
|
||||||
|
|
||||||
export async function fetchInstance() {
|
export async function fetchInstance() {
|
||||||
const meta = await api("meta", {
|
const meta = await api("meta", {
|
||||||
detail: false,
|
detail: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const [k, v] of Object.entries(meta)) {
|
for (const [k, v] of Object.entries(meta)) {
|
||||||
|
|
|
@ -421,7 +421,7 @@ export function getNoteMenu(props: {
|
||||||
|
|
||||||
null,
|
null,
|
||||||
|
|
||||||
instance.experimentalFeatures?.postEditing && isAppearAuthor
|
instance.features.postEditing && isAppearAuthor
|
||||||
? {
|
? {
|
||||||
icon: "ph-pencil-line ph-bold ph-lg",
|
icon: "ph-pencil-line ph-bold ph-lg",
|
||||||
text: i18n.ts.edit,
|
text: i18n.ts.edit,
|
||||||
|
@ -430,7 +430,7 @@ export function getNoteMenu(props: {
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
|
|
||||||
instance.experimentalFeatures?.postEditing
|
instance.features.postEditing
|
||||||
? {
|
? {
|
||||||
icon: "ph-copy ph-bold ph-lg",
|
icon: "ph-copy ph-bold ph-lg",
|
||||||
text: i18n.ts.duplicate,
|
text: i18n.ts.duplicate,
|
||||||
|
|
Loading…
Reference in New Issue