Merge branch 'develop' into feat-1714
This commit is contained in:
@@ -27,7 +27,7 @@ function rename(file: Misskey.entities.DriveFile) {
|
||||
}
|
||||
|
||||
function describe(file: Misskey.entities.DriveFile) {
|
||||
os.popup(defineAsyncComponent(() => import('@/components/MkFileCaptionEditWindow.vue')), {
|
||||
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkFileCaptionEditWindow.vue')), {
|
||||
default: file.comment ?? '',
|
||||
file: file,
|
||||
}, {
|
||||
@@ -37,7 +37,8 @@ function describe(file: Misskey.entities.DriveFile) {
|
||||
comment: caption.length === 0 ? null : caption,
|
||||
});
|
||||
},
|
||||
}, 'closed');
|
||||
closed: () => dispose(),
|
||||
});
|
||||
}
|
||||
|
||||
function toggleSensitive(file: Misskey.entities.DriveFile) {
|
||||
|
@@ -137,10 +137,12 @@ export function getAbuseNoteMenu(note: Misskey.entities.Note, text: string): Men
|
||||
let noteInfo = '';
|
||||
if (note.url ?? note.uri != null) noteInfo = `Note: ${note.url ?? note.uri}\n`;
|
||||
noteInfo += `Local Note: ${localUrl}\n`;
|
||||
os.popup(defineAsyncComponent(() => import('@/components/MkAbuseReportWindow.vue')), {
|
||||
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkAbuseReportWindow.vue')), {
|
||||
user: note.user,
|
||||
initialComment: `${noteInfo}-----\n`,
|
||||
}, {}, 'closed');
|
||||
}, {
|
||||
closed: () => dispose(),
|
||||
});
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -544,7 +546,9 @@ export function getRenoteMenu(props: {
|
||||
const rect = el.getBoundingClientRect();
|
||||
const x = rect.left + (el.offsetWidth / 2);
|
||||
const y = rect.top + (el.offsetHeight / 2);
|
||||
os.popup(MkRippleEffect, { x, y }, {}, 'end');
|
||||
const { dispose } = os.popup(MkRippleEffect, { x, y }, {
|
||||
end: () => dispose(),
|
||||
});
|
||||
}
|
||||
|
||||
if (!props.mock) {
|
||||
@@ -580,7 +584,9 @@ export function getRenoteMenu(props: {
|
||||
const rect = el.getBoundingClientRect();
|
||||
const x = rect.left + (el.offsetWidth / 2);
|
||||
const y = rect.top + (el.offsetHeight / 2);
|
||||
os.popup(MkRippleEffect, { x, y }, {}, 'end');
|
||||
const { dispose } = os.popup(MkRippleEffect, { x, y }, {
|
||||
end: () => dispose(),
|
||||
});
|
||||
}
|
||||
|
||||
const configuredVisibility = defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility;
|
||||
@@ -629,7 +635,9 @@ export function getRenoteMenu(props: {
|
||||
const rect = el.getBoundingClientRect();
|
||||
const x = rect.left + (el.offsetWidth / 2);
|
||||
const y = rect.top + (el.offsetHeight / 2);
|
||||
os.popup(MkRippleEffect, { x, y }, {}, 'end');
|
||||
const { dispose } = os.popup(MkRippleEffect, { x, y }, {
|
||||
end: () => dispose(),
|
||||
});
|
||||
}
|
||||
|
||||
if (!props.mock) {
|
||||
|
@@ -101,9 +101,11 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: IRouter
|
||||
}
|
||||
|
||||
function reportAbuse() {
|
||||
os.popup(defineAsyncComponent(() => import('@/components/MkAbuseReportWindow.vue')), {
|
||||
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkAbuseReportWindow.vue')), {
|
||||
user: user,
|
||||
}, {}, 'closed');
|
||||
}, {
|
||||
closed: () => dispose(),
|
||||
});
|
||||
}
|
||||
|
||||
async function getConfirmed(text: string): Promise<boolean> {
|
||||
|
@@ -103,7 +103,7 @@ export async function installPlugin(code: string, meta?: AiScriptPluginMeta) {
|
||||
}
|
||||
|
||||
const token = realMeta.permissions == null || realMeta.permissions.length === 0 ? null : await new Promise((res, rej) => {
|
||||
os.popup(defineAsyncComponent(() => import('@/components/MkTokenGenerateWindow.vue')), {
|
||||
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkTokenGenerateWindow.vue')), {
|
||||
title: i18n.ts.tokenRequested,
|
||||
information: i18n.ts.pluginTokenRequestedDescription,
|
||||
initialName: realMeta.name,
|
||||
@@ -118,7 +118,8 @@ export async function installPlugin(code: string, meta?: AiScriptPluginMeta) {
|
||||
});
|
||||
res(token);
|
||||
},
|
||||
}, 'closed');
|
||||
closed: () => dispose(),
|
||||
});
|
||||
});
|
||||
|
||||
savePlugin({
|
||||
|
@@ -11,7 +11,7 @@ import { popup } from '@/os.js';
|
||||
export function pleaseLogin(path?: string) {
|
||||
if ($i) return;
|
||||
|
||||
popup(defineAsyncComponent(() => import('@/components/MkSigninDialog.vue')), {
|
||||
const { dispose } = popup(defineAsyncComponent(() => import('@/components/MkSigninDialog.vue')), {
|
||||
autoSet: true,
|
||||
message: i18n.ts.signinRequired,
|
||||
}, {
|
||||
@@ -20,7 +20,8 @@ export function pleaseLogin(path?: string) {
|
||||
window.location.href = path;
|
||||
}
|
||||
},
|
||||
}, 'closed');
|
||||
closed: () => dispose(),
|
||||
});
|
||||
|
||||
throw new Error('signin required');
|
||||
}
|
||||
|
@@ -7,13 +7,3 @@ export async function tick(): Promise<void> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
await new Promise((globalThis.requestIdleCallback ?? setTimeout) as never);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://github.com/misskey-dev/misskey/issues/11267
|
||||
*/
|
||||
export function semaphore(counter = 0, waiting: (() => void)[] = []) {
|
||||
return {
|
||||
acquire: () => ++counter > 1 && new Promise<void>(resolve => waiting.push(resolve)),
|
||||
release: () => --counter && waiting.pop()?.(),
|
||||
};
|
||||
}
|
||||
|
@@ -17,20 +17,16 @@ export function useChartTooltip(opts: { position: 'top' | 'middle' } = { positio
|
||||
borderColor: string;
|
||||
text: string;
|
||||
}[] | null>(null);
|
||||
let disposeTooltipComponent;
|
||||
|
||||
os.popup(MkChartTooltip, {
|
||||
const { dispose: disposeTooltipComponent } = os.popup(MkChartTooltip, {
|
||||
showing: tooltipShowing,
|
||||
x: tooltipX,
|
||||
y: tooltipY,
|
||||
title: tooltipTitle,
|
||||
series: tooltipSeries,
|
||||
}, {}).then(({ dispose }) => {
|
||||
disposeTooltipComponent = dispose;
|
||||
});
|
||||
}, {});
|
||||
|
||||
onUnmounted(() => {
|
||||
if (disposeTooltipComponent) disposeTooltipComponent();
|
||||
disposeTooltipComponent();
|
||||
});
|
||||
|
||||
onDeactivated(() => {
|
||||
|
Reference in New Issue
Block a user